dateFormat.js
1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* 时间处理插件
*/
class dealDate {
constructor() {
this.instance = null;
}
static getInstance() {
if (!this.instance) {
this.instance = new dealDate()
}
return this.instance;
}
/**
* 格式化 yyyy-MM-dd
*/
dateFormatter(date) {
if (!date instanceof Object) {
date = new Date(Date.parse(date));
}
//
}
/**
* 日期字符串转化日期对象
*/
isDateObject(date) {
let dateObj = {};
dateObj = !date instanceof Object ? new Date(Date.parse(date)) : date;
return dateObj
}
/**
* day
*/
getDayDt(date) {
if (!date instanceof Object) {
date = new Date(Date.parse(date));
}
}
/**
* week
*/
getWeekDt(date) {}
/**
* month
*/
getMonthDt(date) {}
/**
* year
*/
getYearDt(date) {}
}
const dealDate = dealDate.getInstance();
export {
dealDate
}