File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -56,20 +56,20 @@ export const defaultShortcuts = [
56
56
* 时间日期转换
57
57
* @param date 当前时间,new Date() 格式
58
58
* @param format 需要转换的时间格式字符串
59
- * @description format 字符串随意,如 `YYYY-mm 、YYYY-mm-dd `
60
- * @description format 季度:"YYYY-mm-dd HH:MM:SS QQQQ"
61
- * @description format 星期:"YYYY-mm-dd HH:MM:SS WWW"
62
- * @description format 几周:"YYYY-mm-dd HH:MM:SS ZZZ"
63
- * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
59
+ * @description format 字符串随意,如 `YYYY-MM 、YYYY-MM-DD `
60
+ * @description format 季度:"YYYY-MM-DD HH:mm:ss QQQQ"
61
+ * @description format 星期:"YYYY-MM-DD HH:mm:ss WWW"
62
+ * @description format 几周:"YYYY-MM-DD HH:mm:ss ZZZ"
63
+ * @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:mm:ss WWW QQQQ ZZZ"
64
64
* @returns 返回拼接后的时间字符串
65
65
*/
66
66
export function formatDate ( date : Date , format ?: string ) : string {
67
67
// 日期不存在,则返回空
68
68
if ( ! date ) {
69
- return '' ;
69
+ return ''
70
70
}
71
71
// 日期存在,则进行格式化
72
- return date ? dayjs ( date ) . format ( format ?? 'YYYY-MM-DD HH:mm:ss' ) : '' ;
72
+ return date ? dayjs ( date ) . format ( format ?? 'YYYY-MM-DD HH:mm:ss' ) : ''
73
73
}
74
74
75
75
/**
@@ -110,7 +110,7 @@ export function getWeek(dateTime: Date): number {
110
110
* @description param 3天: 60 * 60* 24 * 1000 * 3
111
111
* @returns 返回拼接后的时间字符串
112
112
*/
113
- export function formatPast ( param : string | Date , format = 'YYYY-mm-dd HH:MM:SS ' ) : string {
113
+ export function formatPast ( param : string | Date , format = 'YYYY-MM-DD HH:mm:ss ' ) : string {
114
114
// 传入格式处理、存储转换值
115
115
let t : any , s : number
116
116
// 获取js 时间戳
You can’t perform that action at this time.
0 commit comments