Skip to content

Commit 5e28d02

Browse files
fixed date format
* getDay() gives day of the week, replaced with getDate() * getMonth() returns in the range of 0-11, not 1-12
1 parent d49dd97 commit 5e28d02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,17 +265,17 @@ var updateTimebox = function(date) {
265265
var a,b,c,d,e,f,g,z;
266266

267267
a = date.getUTCFullYear();
268-
b = twoZeroPad(date.getUTCMonth());
269-
c = twoZeroPad(date.getUTCDay());
268+
b = twoZeroPad(date.getUTCMonth()+1); // months 0-11
269+
c = twoZeroPad(date.getUTCDate());
270270
e = twoZeroPad(date.getUTCHours());
271271
f = twoZeroPad(date.getUTCMinutes());
272272
g = twoZeroPad(date.getUTCSeconds());
273273

274274
elm.find(".current").text("Current: "+a+'-'+b+'-'+c+' '+e+':'+f+':'+g+" UTC");
275275

276276
a = date.getFullYear();
277-
b = twoZeroPad(date.getMonth());
278-
c = twoZeroPad(date.getDay());
277+
b = twoZeroPad(date.getMonth()+1); // months 0-11
278+
c = twoZeroPad(date.getDate());
279279
e = twoZeroPad(date.getHours());
280280
f = twoZeroPad(date.getMinutes());
281281
g = twoZeroPad(date.getSeconds());

0 commit comments

Comments
 (0)