Date formatting for M/MM and d/dd is wrong

Issue #2 resolved
Luke Horsley
created an issue

In format.js when doing the following:

var aDate = new Date('2014-05-26');
var formatted = String.format('{0:yyyy-MM-dd}', aDate);

I would expect formatted to be '2014-05-26', however in reality it is '2014-04-01'.

This is because formatter.js is using getMonth() (which is base zero) and getDay (which is the day of the week, not the day of the month).

I will try and create a pull request for these issues.


Comments (3)

  1. Log in to comment