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..d8c0d2d21a 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeForm.vue @@ -42,10 +42,10 @@ 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')) + this.$emit('update:value', dt.clone().utc().format('YYYY-MM-DD HH:mm')) return dt.toDate() } else { return null diff --git a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue index 941b485b11..ea0ac72e9f 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/DatetimeTimeForm.vue @@ -50,10 +50,10 @@ 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')) + this.$emit('update:value', dt.clone().utc().format('HH:mm')) return dt.toDate() } else { return new Date()