12-23-上传master

This commit is contained in:
xingsy
2020-12-23 11:14:35 +08:00
parent 9769f83bc8
commit b42e0c1ddd
553 changed files with 56506 additions and 0 deletions

45
src/utils/DateUtils.ts Normal file
View File

@ -0,0 +1,45 @@
/*
* @Author: liqiang
* @Date: 2020-12-02 14:25:23
* @LastEditTime: 2020-12-07 14:59:14
* @LastEditors: Please set LastEditors
* @Description: 日期工具类
* @FilePath: \ebtp-cloud-frontend\src\utils\DateUtils.ts
*/
import moment from "moment";
import { isEmpty } from "./CommonUtils";
/**
* 日期时间格式
*/
export const dateTimeFormatter = 'yyyy-MM-DD HH:mm:ss';
/**
* 用于保存 日期格式化
* @param date
*/
export function saveDateTimeFormatter(date: any) {
if (isEmpty(date)) {
return date;
}
return date.format(dateTimeFormatter);
}
/**
* 用于回显 日期格式化
* @param date
*/
export function echoDateTimeFormatter(date: any) {
if (isEmpty(date)) {
return date;
}
return moment(date, dateTimeFormatter);
}
/**
* 判断当前时间是否超过指定时间
*/
export function nowExceedSpecifiedTime(specifiedTime: string) {
let now = new Date(),
specified = new Date(specifiedTime);
return now.getTime() > specified.getTime();
}