Merge branch 'warunee-dev' into develop
This commit is contained in:
commit
c0e115cfac
1 changed files with 11 additions and 7 deletions
|
|
@ -244,13 +244,17 @@ export const useCounterMixin = defineStore("mixin", () => {
|
|||
}
|
||||
|
||||
function dateToISO(date: Date) {
|
||||
return (
|
||||
date.getFullYear() +
|
||||
"-" +
|
||||
appendLeadingZeroes(date.getMonth() + 1) +
|
||||
"-" +
|
||||
appendLeadingZeroes(date.getDate())
|
||||
);
|
||||
const isValidDate = Boolean(+date);
|
||||
if (!isValidDate) return null;
|
||||
if (isValidDate && date.getFullYear() < 1000) {
|
||||
return (
|
||||
date.getFullYear() +
|
||||
"-" +
|
||||
appendLeadingZeroes(date.getMonth() + 1) +
|
||||
"-" +
|
||||
appendLeadingZeroes(date.getDate())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function appendLeadingZeroes(n: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue