-
-
Notifications
You must be signed in to change notification settings - Fork 183
fix(vue3): replace datetime component with native datetime-local input in EventEditor #839
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,10 +13,12 @@ b-modal(v-if="event && event.id", :id="'edit-modal-' + event.id", ref="eventEdit | |||||||||||||||||||||||
| td {{ event.id }} | ||||||||||||||||||||||||
| tr | ||||||||||||||||||||||||
| th Start | ||||||||||||||||||||||||
| datetime(type="datetime" v-model="start") | ||||||||||||||||||||||||
| td | ||||||||||||||||||||||||
| input(type="datetime-local" step="1" v-model="start") | ||||||||||||||||||||||||
| tr | ||||||||||||||||||||||||
| th End | ||||||||||||||||||||||||
| datetime(type="datetime" v-model="end") | ||||||||||||||||||||||||
| td | ||||||||||||||||||||||||
| input(type="datetime-local" step="1" v-model="end") | ||||||||||||||||||||||||
| tr | ||||||||||||||||||||||||
| th Duration | ||||||||||||||||||||||||
| td {{ friendlyduration(editedEvent.duration) }} | ||||||||||||||||||||||||
|
|
@@ -78,7 +80,7 @@ export default { | |||||||||||||||||||||||
| computed: { | ||||||||||||||||||||||||
| start: { | ||||||||||||||||||||||||
| get: function () { | ||||||||||||||||||||||||
| return moment(this.editedEvent.timestamp).format(); | ||||||||||||||||||||||||
| return moment(this.editedEvent.timestamp).format('YYYY-MM-DDTHH:mm:ss'); | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| set: function (dt) { | ||||||||||||||||||||||||
| // Duration needs to be set first since otherwise the computed for end will use the new timestamp | ||||||||||||||||||||||||
|
|
@@ -89,7 +91,7 @@ export default { | |||||||||||||||||||||||
| end: { | ||||||||||||||||||||||||
| get: function () { | ||||||||||||||||||||||||
| const end = moment(this.editedEvent.timestamp).add(this.editedEvent.duration, 'seconds'); | ||||||||||||||||||||||||
| return end.format(); | ||||||||||||||||||||||||
| return end.format('YYYY-MM-DDTHH:mm:ss'); | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
|
Comment on lines
91
to
95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 0d77789 — format strings updated to |
||||||||||||||||||||||||
| set: function (dt) { | ||||||||||||||||||||||||
| this.editedEvent.duration = moment(dt).diff(this.editedEvent.timestamp, 'seconds'); | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
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.
step="1"on the inputs (which enables the seconds field in browsers), the format string should include seconds. Without this, the getter returns a string with no seconds component and the browser will reject or silently zero the seconds field even if the user typed them.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.
Fixed in 0d77789 — format strings updated to
YYYY-MM-DDTHH:mm:ssandstep="1"added to both datetime-local inputs.