You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First up, awesome library. Thanks for all the hard work.
This is more of a usability/understandability issue. Right now dates are being parsed 0 based. This means that the following happens
fecha.parse('2010-02-02', 'YYYY-MM-DD');// 02 March 2010
fecha.parse('2010-03-02', 'YYYY-MM-DD');// 02 April 2010
fecha.parse('2010-04-02', 'YYYY-MM-DD');// 02 May 2010
The documentation seems to suggest that this is expected behavior
As you can imagine this is a land mine for a any developer (including myself) that didn't read the fine print.
My recommendation is that is should parse the dates non-zero based so that its more predictable
The text was updated successfully, but these errors were encountered:
I am not able to reproduce the issue you are talking about. What browser are you using? I tested in Chrome and got the following results.
fecha.parse('2010-02-02','YYYY-MM-DD');// 02 February 2010fecha.parse('2010-03-02','YYYY-MM-DD');// 02 March 2010fecha.parse('2010-04-02','YYYY-MM-DD');// 02 April 2010
Javascript dates are zero based for the month. This library returns a normal javascript Date object. The date.getMonth() returns a zero based month and the javascript Date constructor also expects a zero based month.
// new Date(2010, 11, 10, 14, 11, 12) == December 10, 2010 2:11:12PMfecha.parse('10-12-10 14:11:12','YY-MM-DD HH:mm:ss');// new Date(2010, 11, 10, 14, 11, 12)
Here is a link to more info about the javascript Date object. The notes talk about the 0 based month
First up, awesome library. Thanks for all the hard work.
This is more of a usability/understandability issue. Right now dates are being parsed 0 based. This means that the following happens
The documentation seems to suggest that this is expected behavior
As you can imagine this is a land mine for a any developer (including myself) that didn't read the fine print.
My recommendation is that is should parse the dates non-zero based so that its more predictable
The text was updated successfully, but these errors were encountered: