From e2377ee11b68d03e3fdfa45322bc424344f9f689 Mon Sep 17 00:00:00 2001 From: Samuel Barmet Date: Tue, 14 Apr 2026 22:45:25 +0200 Subject: [PATCH 1/3] fix(datetime): parse stored values as UTC in edit form getters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 78f8131a moved datetime handling from a backend TimezoneHelper to frontend-side UTC conversion, updating display formatters and form setters to use .utc()/.utc().local(). The form getters (which load the stored value into the date picker) were missed and still parsed the stored UTC string as local time. As a result, every open→save cycle of the edit form subtracted the current UTC offset (DST-aware: -2h in summer CEST, -1h in winter CET). Fix: update the three affected getters to use Moment.utc(...).local().toDate() to match the pattern already used by the setters and display formatters. Fixes #2479 Signed-off-by: Samuel Barmet --- .../components/ncTable/partials/TableCellDateTime.vue | 8 ++++---- .../ncTable/partials/rowTypePartials/DatetimeForm.vue | 2 +- .../ncTable/partials/rowTypePartials/DatetimeTimeForm.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shared/components/ncTable/partials/TableCellDateTime.vue b/src/shared/components/ncTable/partials/TableCellDateTime.vue index fb3fb7466b..bfc8ad2c8d 100644 --- a/src/shared/components/ncTable/partials/TableCellDateTime.vue +++ b/src/shared/components/ncTable/partials/TableCellDateTime.vue @@ -123,15 +123,15 @@ export default { const format = this.getDateFormat() if (this.column.type === 'datetime-time') { - const timeMoment = Moment(this.value, format) + const timeMoment = Moment.utc(this.value, format) if (timeMoment.isValid()) { - this.editDateTimeValue = timeMoment.toDate() + this.editDateTimeValue = timeMoment.local().toDate() } else { this.editDateTimeValue = new Date() } } else { - const parsedMoment = Moment(this.value, format) - this.editDateTimeValue = parsedMoment.isValid() ? parsedMoment.toDate() : null + const parsedMoment = Moment.utc(this.value, format) + this.editDateTimeValue = parsedMoment.isValid() ? parsedMoment.local().toDate() : null } } else if ((this.value === null || this.value === '') && this.column.datetimeDefault) { if (this.column.datetimeDefault === 'now' || this.column.datetimeDefault === 'today') { diff --git a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue index 0bdd0735f7..8a19f2a6e9 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue @@ -42,7 +42,7 @@ export default { localValue: { get() { if (this.value !== null && this.value !== 'none') { - return Moment(this.value, 'YYYY-MM-DD HH:mm').toDate() + return Moment.utc(this.value, 'YYYY-MM-DD HH:mm').local().toDate() } else if (this.value === null && this.column.datetimeDefault === 'now') { const dt = Moment() this.$emit('update:value', dt.format('YYYY-MM-DD HH:mm')) diff --git a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue index 941b485b11..27c0d7c968 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue @@ -50,7 +50,7 @@ export default { localValue: { get() { if (this.value !== null && this.value !== 'none') { - return Moment(this.value, 'HH:mm').toDate() + return Moment.utc(this.value, 'HH:mm').local().toDate() } else if (this.value === null && this.column.datetimeDefault === 'now') { const dt = Moment() this.$emit('update:value', dt.format('HH:mm')) From 80733df37dc6ef0aa4ccfd8e93982961553a92fe Mon Sep 17 00:00:00 2001 From: Samuel <90173331+samuelx12@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:28:48 +0200 Subject: [PATCH 2/3] Update src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue Co-authored-by: Enjeck <32180937+enjeck@users.noreply.github.com> Signed-off-by: Samuel <90173331+samuelx12@users.noreply.github.com> --- .../ncTable/partials/rowTypePartials/DatetimeTimeForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue index 27c0d7c968..ea0ac72e9f 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue @@ -53,7 +53,7 @@ export default { return Moment.utc(this.value, 'HH:mm').local().toDate() } else if (this.value === null && this.column.datetimeDefault === 'now') { const dt = Moment() - this.$emit('update:value', dt.format('HH:mm')) + this.$emit('update:value', dt.clone().utc().format('HH:mm')) return dt.toDate() } else { return new Date() From b058613d15aff587d59d3383f09b93ee265c7e4f Mon Sep 17 00:00:00 2001 From: Samuel <90173331+samuelx12@users.noreply.github.com> Date: Fri, 24 Apr 2026 12:29:07 +0200 Subject: [PATCH 3/3] Update src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue Co-authored-by: Enjeck <32180937+enjeck@users.noreply.github.com> Signed-off-by: Samuel <90173331+samuelx12@users.noreply.github.com> --- .../ncTable/partials/rowTypePartials/DatetimeForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue index 8a19f2a6e9..d8c0d2d21a 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue @@ -45,7 +45,7 @@ export default { return Moment.utc(this.value, 'YYYY-MM-DD HH:mm').local().toDate() } else if (this.value === null && this.column.datetimeDefault === 'now') { const dt = Moment() - this.$emit('update:value', dt.format('YYYY-MM-DD HH:mm')) + this.$emit('update:value', dt.clone().utc().format('YYYY-MM-DD HH:mm')) return dt.toDate() } else { return null