diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index f3e429f4f..39f2edea5 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -244,16 +244,18 @@ export const useCounterMixin = defineStore("mixin", () => { } function dateToISO(date: Date) { - const isValidDate = Boolean(+date); - if (!isValidDate) return null; - if (isValidDate && date.getFullYear() < 1000) { + if (date != null) { + const srcDate = new Date(date) + return ( - date.getFullYear() + + srcDate.getFullYear() + "-" + - appendLeadingZeroes(date.getMonth() + 1) + + appendLeadingZeroes(srcDate.getMonth() + 1) + "-" + - appendLeadingZeroes(date.getDate()) + appendLeadingZeroes(srcDate.getDate()) ); + } else { + return "" } }