-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix handling of two digit dates to be in the 2000s, not the 1900s #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Realised I edited the build files and not the source files. Expect a fix shortly. |
|
I was initially going to merge this in, but now I’m starting to reconsider. There was another PR (#75) much earlier that suggested this as well. But I think the appropriate way to resolve is with a $( '.datepicker' ).pickadate({
format: 'd mmmm, ‘yy',
formatSubmit: 'yyyy-mm-dd'
});This ensures the date will be parsed correctly :). I’ll update the docs to explicitly state this. Cheers! |
|
Does this pass the tests in this pull request?— On Sun, Apr 13, 2014 at 12:19 AM, amsul notifications@github.com wrote:
|
|
Yup, it would - so long as you also have a |
|
Please give the tests a run, because the issue is deeper than just date formatting. — On Sun, Apr 13, 2014 at 12:34 AM, amsul notifications@github.com wrote:
|
|
What’s the deeper issue? The tests are incomplete as they are.. there’s no |
|
It's been a while, but if I remember correctly it doesn't parse the date correctly, and it doesn't pick the century you would assume it would. This was inspired fix by moment.js. — On Sun, Apr 13, 2014 at 12:44 AM, amsul notifications@github.com wrote:
|
|
Yes, it definitely wouldn’t parse correctly without a There’s nothing wrong with the fix. It makes sense that moment.js would do that - it’s a date parsing library. But for the purposes of a date picker, if the value you present to your user is formatted |
|
I agree that it should be, but our usage of the date picker doesn't save the date anywhere as we treat is as a pass through value which is short lived and I tried setting everything as per the instructions in the manual but it didn't work. Not in front of my computer so I can't check if your configuration works for our use case yet. Thanks for following up. — On Sun, Apr 13, 2014 at 12:53 AM, amsul notifications@github.com wrote:
|
|
Ah, I see. Well the instructions have been updated - which will be on the live site by the end of the weekend :) |
|
dd.mm.yy still parsing as 1900 |
Quick fix to make sure two digit dates < 68 is treated as dates in this century and not the last one. Includes a fix for month indexing by @SlikNL.