migrate month range selection sheet / dialog to composition API and typescript

This commit is contained in:
MaysWind
2025-01-11 17:57:14 +08:00
parent 8c7fc0fef9
commit c73dcb51e4
5 changed files with 236 additions and 213 deletions
+9
View File
@@ -38,6 +38,15 @@ export function isYearMonthValid(year: number, month: number): boolean {
return year > 0 && month >= 0 && month <= 11;
}
export function getYearMonthObjectFromUnixTime(unixTime: number): YearMonth {
const datetime = moment.unix(unixTime);
return {
year: datetime.year(),
month: datetime.month()
};
}
export function getYearMonthObjectFromString(yearMonth: string): YearMonth | null {
if (!isString(yearMonth)) {
return null;