cloud-web-corejs 1.0.54-dev.200 → 1.0.54-dev.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3325,7 +3325,7 @@ export const businessFields = [
3325
3325
  options: {
3326
3326
  name: "",
3327
3327
  keyNameEnabled: !0,
3328
- keyName: "modfiy_date",
3328
+ keyName: "modify_date",
3329
3329
  label: "更新时间",
3330
3330
  submitFlag: true,
3331
3331
  formField: "",
@@ -103,7 +103,7 @@ export default {
103
103
  "create_by-text": "创建人",
104
104
  "modify_by-text": "更新人",
105
105
  "create_date-text": "创建时间",
106
- "modfiy_date-text": "更新时间",
106
+ "modify_date-text": "更新时间",
107
107
  "user-vabsearch": "用户(单选)",
108
108
  "saleOrg-vabsearch": "机构(单选)",
109
109
  "user-project-tag": "用户(多选)",
@@ -1,57 +1,48 @@
1
+ import dayjs from 'dayjs'
2
+
3
+ function validateDate(dateStr) {
4
+ let date = new Date( Date.parse(dateStr) )
5
+ return (date instanceof Date) && !isNaN(date.getTime())
6
+ }
1
7
 
2
8
  export function formatDate1(date) {
3
- if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
9
+ if (!validateDate(date)) {
4
10
  return date;
5
11
  }
6
- date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Date
7
- let y = date.getFullYear();
8
- let m = date.getMonth() + 1;
9
- m = m < 10 ? '0' + m : m;
10
- let d = date.getDate();
11
- d = d < 10 ? ('0' + d) : d;
12
- return y + '-' + m + '-' + d;
12
+
13
+ return dayjs(date).format('YYYY-MM-DD')
13
14
  }
14
15
 
15
16
  export function formatDate2(date) {
16
- if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
17
+ if (!validateDate(date)) {
17
18
  return date;
18
19
  }
19
- date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Date
20
- let y = date.getFullYear();
21
- let m = date.getMonth() + 1;
22
- m = m < 10 ? '0' + m : m;
23
- let d = date.getDate();
24
- d = d < 10 ? ('0' + d) : d;
25
- return y + '/' + m + '/' + d;
20
+
21
+ return dayjs(date).format('YYYY/MM/DD')
26
22
  }
27
23
 
28
24
  export function formatDate3(date) {
29
- if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
25
+ if (!validateDate(date)) {
30
26
  return date;
31
27
  }
32
- date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Date
33
- let y = date.getFullYear();
34
- let m = date.getMonth() + 1;
35
- m = m < 10 ? '0' + m : m;
36
- let d = date.getDate();
37
- d = d < 10 ? ('0' + d) : d;
38
- return y + '年' + m + '月' + d +'日';
28
+
29
+ return dayjs(date).format('YYYY年MM月DD日')
39
30
  }
40
31
 
41
32
  export function formatDate4(date) {
42
- if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date"){
33
+ if (!validateDate(date)) {
43
34
  return date;
44
35
  }
45
- date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Date
46
- return date.toLocaleString()
36
+
37
+ return dayjs(date).format('YYYY-MM-DD HH:mm:ss')
47
38
  }
48
39
 
49
40
  export function formatDate5(date) {
50
- if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
41
+ if (!validateDate(date)) {
51
42
  return date;
52
43
  }
53
- date = new Date(Date.parse(date.replace(/-/g, "/"))); //转换成Data();
54
- return date.toLocaleString('chinese', { hour12: false })
44
+
45
+ return dayjs(date).format('YYYY-MM-DD hh:mm:ss')
55
46
  }
56
47
 
57
48
  // ###,###,###,##0.######