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

b-form-datepicker value format #5232

Closed
Dual-Ice opened this issue Apr 23, 2020 · 2 comments · Fixed by #5242 · May be fixed by leonyork/cognito-oauth2-demo#1
Closed

b-form-datepicker value format #5232

Dual-Ice opened this issue Apr 23, 2020 · 2 comments · Fixed by #5242 · May be fixed by leonyork/cognito-oauth2-demo#1

Comments

@Dual-Ice
Copy link

Dual-Ice commented Apr 23, 2020

Is it possible to pass value for datepicker in this format: '2020-04-09 00:00:00' ?
Example:
https://codepen.io/FeonoR/pen/oNjBwwW

Server sends date in this format and i don't want to create computed properties for correcting date. Now I am using another datepicker (https://github.com/mengxiong10/vue2-datepicker) and it show this date correctly, but I want to reduce project dependencies and use all components of BV.

@tmorehouse
Copy link
Member

tmorehouse commented Apr 23, 2020

Currently it supports the format supported by native HTML5 date type input (YYYY-MM-DD) which doesn't support date strings with time portions).

But we might be able to modify the input check regular expression to ignore anything after the first whitespace character, although it will probably trigger an unintended change event since the supplied value will be different than the internal parsed value.

But the current workaround would be a computed prop that strips anything from the whitespace onwards, or use a method to pre-massage the data from the server.

@Dual-Ice
Copy link
Author

Dual-Ice commented Apr 23, 2020

Thanks for answer, if you are improve this moment it will be great. As for the workaround, I'll think about it.

jacobmllr95 pushed a commit that referenced this issue Apr 24, 2020
closes #5232) (#5242)

* feat(b-calendar, b-form-datepicker): relax date `YYYY-MM-DD` string matching (closes #5232)

* Update date.spec.js
@tmorehouse tmorehouse added the Status: Fixed / Implemented label May 10, 2020
@jacobmllr95 jacobmllr95 moved this from Features to Completed in Roadmap Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment