时间的切换
This commit is contained in:
@ -33,6 +33,14 @@ class DateUtils {
|
||||
};
|
||||
}
|
||||
|
||||
static MonthStrToDate(dateStr: string): Date {
|
||||
const year = parseInt(dateStr.split('年')[0]);
|
||||
const month = parseInt(dateStr.split('年')[1].split('月')[0]) - 1; // 月份从0开始
|
||||
|
||||
const date = new Date(year, month, 1);
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定年份和月的范围
|
||||
* @param year 年份
|
||||
|
||||
Reference in New Issue
Block a user