-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
feat(runtime-dom): support input type date in v-model with date modifier #7786
base: minor
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good👍🏻
Size ReportBundles
Usages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was just playing with this and it seems to break typing in values via the keyboard: Testing in Chrome and Firefox, it seems to be broken in slightly different ways, but in both cases I can't enter values by typing in the date I want. The dropdown calendar works fine. My local date format is Without the |
const year = pad(value.getFullYear(), 4) | ||
const month = pad(value.getMonth() + 1, 2) | ||
const date = pad(value.getDate(), 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be using their UTC equivalents?
As far as I can tell, the browser creates a Date object with the time set to midnight UTC for valueAsDate
. But for people in timezones with negative offsets (e.g. the Americas), that corresponds to a local time on the previous day.
In my testing, I set my timezone to -0500
and then picked a date using the dropdown. The input then jumps to the previous day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank your review ,
what you found out is right , i edit my code , here ⬇️
const year = pad(value.getUTCFullYear(), 4)
const month = pad(value.getUTCMonth() + 1, 2)
const date = pad(value.getUTCDate(), 2)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…js#11652) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Evan You <[email protected]>
* chore: fix typo * chore: update
…from effect scope (vuejs#11665)
f983846
to
fbc0c42
Compare
@vue/compiler-ssr
@vue/compiler-core
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-dom
@vue/runtime-core
@vue/server-renderer
@vue/shared
@vue/compat
vue
@vue/compiler-dom
commit: |
This pr is a little bit old. |
close: #7738
Currently it is cumbersome to use native input type="date" elements, as their native 'value' is a date 'string' (such as 2023-02-16), you always need to provide an intermediate conversion in order to use the value of your input as an actual Date, or as a timestamp.
Now,you can directly use Date value,as shown below: