|
|
|
@ -119,4 +119,21 @@ export class DateUtils { |
|
|
|
|
|
|
|
|
|
return returnObj; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取时间 |
|
|
|
|
* @param startTime 开始时间 |
|
|
|
|
* @param endTime 结束时间 |
|
|
|
|
*/ |
|
|
|
|
public static getDateSelectType(startTime: Date, endTime: Date): number { |
|
|
|
|
const type = 0; // 未知
|
|
|
|
|
for (let type of DateSelectType) { |
|
|
|
|
let date = this.getDate(new Date(), type.value); |
|
|
|
|
if (startTime.toLocaleDateString() == new Date(date.timeS).toLocaleDateString() |
|
|
|
|
&& endTime.toLocaleDateString() == new Date(date.timeE).toLocaleDateString()) { |
|
|
|
|
return type.value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return type; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|