fix(vue3): replace datetime component with native datetime-local input in EventEditor#839
Conversation
Greptile SummaryThis PR unblocks event editing on the
Confidence Score: 5/5Safe to merge; the migration to native datetime-local is mechanically correct and second-precision is properly preserved. The single changed file performs a straightforward component swap. The computed getter/setter logic and the duration-invariant ordering are unchanged and correct. The only new concern — an unguarded empty-field state — requires deliberate user action and would produce an API-level error rather than silent data loss. No files require special attention beyond the one comment left on EventEditor.vue regarding empty-input handling. Important Files Changed
Reviews (2): Last reviewed commit: "fix(vue3): restore seconds precision in ..." | Re-trigger Greptile |
| tr | ||
| th Start | ||
| datetime(type="datetime" v-model="start") | ||
| td | ||
| input(type="datetime-local" v-model="start") | ||
| tr | ||
| th End | ||
| datetime(type="datetime" v-model="end") | ||
| td | ||
| input(type="datetime-local" v-model="end") |
There was a problem hiding this comment.
Second-level precision is silently dropped. The
'YYYY-MM-DDTHH:mm' format truncates seconds from both the start and end getters. Duration arithmetic then runs on these rounded strings, so any edit to either field can silently shift the stored timestamp or duration by up to 59 seconds. For example, an event ending at 10:25:15 is shown as 10:25; if the user adjusts the start time, the duration is recalculated against the truncated 10:25, discarding the 15-second remainder. Native datetime-local inputs support second precision when step="1" is set and the value includes seconds.
| tr | |
| th Start | |
| datetime(type="datetime" v-model="start") | |
| td | |
| input(type="datetime-local" v-model="start") | |
| tr | |
| th End | |
| datetime(type="datetime" v-model="end") | |
| td | |
| input(type="datetime-local" v-model="end") | |
| tr | |
| th Start | |
| td | |
| input(type="datetime-local" step="1" v-model="start") | |
| tr | |
| th End | |
| td | |
| input(type="datetime-local" step="1" v-model="end") |
There was a problem hiding this comment.
Fixed in 0d77789 — format strings updated to YYYY-MM-DDTHH:mm:ss and step="1" added to both datetime-local inputs.
| start: { | ||
| get: function () { | ||
| return moment(this.editedEvent.timestamp).format(); | ||
| return moment(this.editedEvent.timestamp).format('YYYY-MM-DDTHH:mm'); | ||
| }, |
There was a problem hiding this comment.
To match
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.
| start: { | |
| get: function () { | |
| return moment(this.editedEvent.timestamp).format(); | |
| return moment(this.editedEvent.timestamp).format('YYYY-MM-DDTHH:mm'); | |
| }, | |
| start: { | |
| get: function () { | |
| return moment(this.editedEvent.timestamp).format('YYYY-MM-DDTHH:mm:ss'); | |
| }, |
There was a problem hiding this comment.
Fixed in 0d77789 — format strings updated to YYYY-MM-DDTHH:mm:ss and step="1" added to both datetime-local inputs.
| end: { | ||
| get: function () { | ||
| const end = moment(this.editedEvent.timestamp).add(this.editedEvent.duration, 'seconds'); | ||
| return end.format(); | ||
| return end.format('YYYY-MM-DDTHH:mm'); | ||
| }, |
There was a problem hiding this comment.
Same seconds-precision fix needed for the
end getter.
| end: { | |
| get: function () { | |
| const end = moment(this.editedEvent.timestamp).add(this.editedEvent.duration, 'seconds'); | |
| return end.format(); | |
| return end.format('YYYY-MM-DDTHH:mm'); | |
| }, | |
| end: { | |
| get: function () { | |
| const end = moment(this.editedEvent.timestamp).add(this.editedEvent.duration, 'seconds'); | |
| return end.format('YYYY-MM-DDTHH:mm:ss'); | |
| }, |
There was a problem hiding this comment.
Fixed in 0d77789 — format strings updated to YYYY-MM-DDTHH:mm:ss and step="1" added to both datetime-local inputs.
Add step='1' to datetime-local inputs and use HH:mm:ss format strings to prevent silent truncation of seconds when editing event timestamps. Without this, any edit rounded timestamps to the nearest minute and corrupted duration arithmetic by up to 59 seconds.
|
Fixed the seconds-precision regression flagged by Greptile (0d77789):
Without this, any edit would silently round timestamps to the nearest minute and corrupt duration arithmetic by up to 59 seconds. |
|
Self-review pass: Greptile gave 5/5 confidence ('safe to merge'). The computed getter/setter logic and duration-invariant ordering are unchanged. seconds-precision regression was already fixed. @ErikBjare this is ready to merge. |
Replaces the Vue 2-only
datetimecomponent in EventEditor with native<input type="datetime-local">, preserving the existing save/delete flow and computed start/end/duration logic.\n\n- UsesYYYY-MM-DDTHH:mmformat for datetime-local compatibility\n- Keeps the existing computed start/end properties that maintain duration invariant\n- Unblocks event editing on the vue3 branch where vue-datetime was removed\n\nRefs: #788 (umbrella)