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
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
The dateParser (ui.bootstrap.dateparser) caches previosuly used parsers in "this.parsers". A new parser is only created, if no parser exists for the current date format.
This is a problem if two locales use the same date format and the dateParser was previously used with another language (e.g. with the DatePicker). The parser for the previous locale (with wrong month names, ...) is used in this case instead of creating a new one.
In this case for example the datepicker will not be able to select a different date, as it cannot parse the date in the input field (as e.g. the month names of the current language are different than those of the previous language).
A workaround is to reset dateParser.parsers manually whenever the locale changes:
dateParser.parsers={}
The text was updated successfully, but these errors were encountered:
Seems as if also formatCodeToRegex must be set according to the new locale, as the regex is set fixed to the locale that was active when the dateParser service was started.
Hello, I don't know if is the same issue, but since I've changed version from 0.12.0 to 0.13.5 and got problems
For example, my date model has value "2015-12-21T20:59:00" and I use dateFormat as "yyyy/MM/dd HH:mm" and the result was 2014/12/21 20:59.
However now I get have invalid model state, because when it tries to parse dateFormat ( var date = dateParser.parse(value, dateFormat);), returns undefined
@almeidaalex: as you did not change the locale, it is probably not related to this issue.
I am not a member of the bootstrap dev-team. But from what I saw, older versions of the datepicker had a workaround to use "new Date(date)" to parse the date. This is gone now. So as "2015-12-21T20:59:00" does not match "yyyy/MM/dd HH:mm" (because of '/' vs '-') the dateparser will fail. In previous versions "new Date("2015-12-21T20:59:00")" was called which might have been able to parse it. Now it fails.
I think you just had luck that it worked and it was not the expected behavior.
As you did not use the datepiecker but dateparser directly, the above might not be the reason.
Open a new issue report if you think that this must be fixed. A bootstrap dev should comment on this.
The dateParser (ui.bootstrap.dateparser) caches previosuly used parsers in "this.parsers". A new parser is only created, if no parser exists for the current date format.
This is a problem if two locales use the same date format and the dateParser was previously used with another language (e.g. with the DatePicker). The parser for the previous locale (with wrong month names, ...) is used in this case instead of creating a new one.
In this case for example the datepicker will not be able to select a different date, as it cannot parse the date in the input field (as e.g. the month names of the current language are different than those of the previous language).
A workaround is to reset dateParser.parsers manually whenever the locale changes:
The text was updated successfully, but these errors were encountered: