upd: make schedule time work cross timezones

This commit is contained in:
Marie 2024-12-15 22:41:16 +01:00
parent e2352839e4
commit e50ff9db6a
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555
5 changed files with 28 additions and 42 deletions

View file

@ -18,6 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, ref, watch } from 'vue';
import moment from 'moment';
import MkInput from '@/components/MkInput.vue';
import { formatDateTimeString } from '@/scripts/format-time-string.js';
import { addTime } from '@/scripts/time.js';
@ -46,7 +47,7 @@ if (props.modelValue.scheduledAt) {
function get() {
const calcAt = () => {
return new Date(`${ atDate.value } ${ atTime.value }`).getTime();
return moment(`${ atDate.value } ${ atTime.value }`).utc().valueOf();
};
return { scheduledAt: calcAt() };