mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
migrate month range selection sheet / dialog to composition API and typescript
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user