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

Datepicker not validate correct dateInputFormat #2699

Closed
fchiumeo opened this issue Sep 19, 2017 · 3 comments
Closed

Datepicker not validate correct dateInputFormat #2699

fchiumeo opened this issue Sep 19, 2017 · 3 comments

Comments

@fchiumeo
Copy link

const _locale = getLocale(this._picker._config.locale);
if (!_locale) {
throw new Error(
`Locale "${this._picker._config
.locale}" is not defined, please add it with "defineLocale(...)"`
);
}
if (typeof value === 'string') {
const date = new Date(_locale.preparse(value));
this._picker.bsValue = isNaN(date.valueOf()) ? null : date;
}

datepicker directive not create new date with correct bsConfig.dateInputFormat or locale setted

i.e: 19/09/2017 (DD/MM/YYYY - spanish format) get invalid date
09/11/2017 transform to 11/09/2017

@leomayer
Copy link

I guess there are several issues with the locales - reported in different issues, e.g. #2622 as well as directly related to yours #2694 (which might be a the same as yours)

@valorkin
Copy link
Member

valorkin commented Oct 2, 2017

yes, duplicate of #2622 and #2694
fixed with #2330

@valorkin valorkin closed this as completed Oct 2, 2017
@rjwijnen
Copy link

rjwijnen commented Oct 2, 2017

How is this fixed with #2330 ?

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

4 participants