Skip to content
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

After Selecting A Date, Restoring Focus On Field Causes Year To Be 0000 #206

Open
wisam22 opened this issue Apr 26, 2017 · 2 comments
Open

Comments

@wisam22
Copy link

wisam22 commented Apr 26, 2017

Love the library, very convenient solution to a common problem. However, I keep encountering the issue where after selecting a date, trying to reopen the date picker to change the date causes the year to break and always show as "0000".

@wisam22
Copy link
Author

wisam22 commented May 5, 2017

Turns out this issue was specifically happening when I included a comma in my "format" parameter. I've decided to use a different format for the time being.
I was using: MMM DD, YYYY

@Ni03
Copy link

Ni03 commented May 19, 2017

Solve problem when we change a value of parseSplitDelimiter option of the plugin with ' - ' (Exactly Same Space Comma Space).
There is an issue with regex. When we try to set Mode as range & Format as MMM DD, YYYY (especially having comma) then split 2 dates string with 4 dates
Ex
Consider selected dates are Apr 1, 2017 - May 19, 2017.
when try to reopen calendar then split string with a regex /,\s*|\s+-\s+/ (that is parseSplitDelimiter option) then we get array
[ "Apr 1" , "2017" , "May 19" , "2017" ]

there are 4 dates, generate because of the wrong regex.
like,
[
Sat Apr 01 0 12:00:00 GMT+0530 (IST),
Fri Jan 20 17 12:00:00 GMT+0530 (IST),
Fri May 19 0 12:00:00 GMT+0530 (IST),
Fri Jan 20 17 12:00:00 GMT+0530 (IST)
]

that's why shows Apr & May month with 0000 years.
When we change parseSplitDelimiter option with ' - '
String split with correct two dates.
[ "Apr 1, 2017" , "May 19, 2017" ]
then generate only two correct dates.
like,
[
Sat Apr 01 2017 12:00:00 GMT+0530 (IST),
Fri May 19 2017 12:00:00 GMT+0530 (IST)
]

This is a temporary solution, need to find correct regex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants