Skip to content

Commit

Permalink
fix: unable to load ScheduleCron.vue in en
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jun 24, 2024
1 parent ea4a97f commit 4b64d4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crawlab-ui",
"version": "0.6.3-10",
"version": "0.6.3-11",
"private": false,
"author": {
"name": "Marvin Zhang",
Expand Down
5 changes: 2 additions & 3 deletions src/components/schedule/ScheduleCron.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { computed } from 'vue';
import { CronExpression, parseExpression } from 'cron-parser';
import cronstrue from 'cronstrue/i18n';
import dayjs from 'dayjs';
import en from 'dayjs/locale/en.js';
import zh from 'dayjs/locale/zh.js';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import { useI18n } from 'vue-i18n';
Expand Down Expand Up @@ -52,9 +51,9 @@ const next = computed<string | undefined>(() => {
return t('common.status.unknown');
}
if (getI18n().global.locale.value === 'zh') {
return dayjs(interval.value.next().getTime()).locale(zh)?.format('llll');
return dayjs(interval.value.next().getTime())?.locale(zh)?.format('llll');
} else {
return dayjs(interval.value.next().getTime())?.locale(en)?.format('llll');
return dayjs(interval.value.next().getTime())?.format('llll');
}
});
Expand Down

0 comments on commit 4b64d4c

Please sign in to comment.