Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: utc issue

mertmit9d271fe3105f
diff --git a/packages/nc-gui/components/dashboard/settings/sync/Schedule.vue b/packages/nc-gui/components/dashboard/settings/sync/Schedule.vue
index 35a9a53daf..6a71308f0f 100644
--- a/packages/nc-gui/components/dashboard/settings/sync/Schedule.vue
+++ b/packages/nc-gui/components/dashboard/settings/sync/Schedule.vue
@@ -3,6 +3,8 @@ const props = defineProps<{
modelValue?: string
}>()
+const emit = defineEmits(['change'])
+
const vModel = useVModel(props, 'modelValue')
const intervalOptions = computed(() => {
@@ -17,13 +19,15 @@ const selectedInterval = ref('hourly')
const onChange = (value: string) => {
// derive cron expression based on selected value
const date = new Date()
- const minutes = date.getMinutes()
- const hours = date.getHours()
+ const minutes = date.getUTCMinutes()
+ const hours = date.getUTCHours()
if (value === 'hourly') {
vModel.value = `${minutes} * * * *`
} else if (value === 'daily') {
vModel.value = `0 ${hours} * * *`
}
+
+ emit('change', vModel.value)
}
onMounted(() => {
diff --git a/packages/nc-gui/components/dashboard/settings/sync/Settings.vue b/packages/nc-gui/components/dashboard/settings/sync/Settings.vue
index 34f67720fb..d283131cc8 100644
--- a/packages/nc-gui/components/dashboard/settings/sync/Settings.vue
+++ b/packages/nc-gui/components/dashboard/settings/sync/Settings.vue
@@ -68,7 +68,7 @@ const formModel = computed(() => {
</a-col>
<a-col v-if="formModel.sync_trigger === 'schedule'" :span="12">
<a-form-item label="Sync Schedule" v-bind="validateInfosSyncConfig.sync_trigger_cron" hide-required-mark>
- <DashboardSettingsSyncSchedule v-model="formModel.sync_trigger_cron" />
+ <DashboardSettingsSyncSchedule v-model="formModel.sync_trigger_cron" @change="syncConfigEditFormChanged = true" />
</a-form-item>
</a-col>
</a-row>