-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
v-model to accept ISO datetimes #804
Comments
The You can also use |
That's basically what I was referring to: boilerplate conversion. Instead of doing: <vue-date-picker v-model="fields.startTime" model-type="iso" /> one has to repeat this for each field: <vue-date-picker
:model-value="fields.startTime"
@update:model-value="v => fields.startTime = v?.toISOString()"
/> I'm not really following why timestamps have first class support and ISO time, arguably much more popular format, doesn't deserve one. 🤔 |
You are right, I'll add it, it is a minor thing to implement. |
Is your feature request related to a problem? Please describe.
Typically, external APIs send and receive dates in ISO datetime format. I'm always frustrated that I need to add cumbersome watch/computed/type conversion boilerplate to convert between ISO datetime and the formats the date picker supports (native Date or timestamp or date-fns tokens).
Describe the solution you'd like
I'd like
model-type
to support new option:iso
.Describe alternatives you've considered
For dates (not date+time+timezone) I could use
model-type="yyyy-MM-dd"
. However, it doesn't seem possible to construct the full ISO8601 datetime string asT
seems to be a reserved token in date-fns formatter that you're using. Also, this kind of manual format templating is prone to mistakes/typos.The text was updated successfully, but these errors were encountered: