@daysnap/utils 0.0.50 → 0.0.51
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.
- package/es/formatDate.js +2 -1
- package/es/formatDateStr.d.ts +4 -0
- package/es/formatDateStr.js +6 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/lib/formatDate.js +2 -1
- package/lib/formatDateStr.d.ts +4 -0
- package/lib/formatDateStr.js +10 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +1 -1
package/es/formatDate.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isString } from './isString';
|
|
2
|
+
import { formatDateStr } from './formatDateStr';
|
|
2
3
|
/**
|
|
3
4
|
* 格式化日期
|
|
4
5
|
*/
|
|
@@ -6,7 +7,7 @@ export function formatDate(val, fmt = 'yyyy-MM-dd hh:mm:ss') {
|
|
|
6
7
|
let v = val;
|
|
7
8
|
if (isString(v)) {
|
|
8
9
|
// fix iOS new Date() 不支持 2020-01-01 格式,需转换为 2020/01/01
|
|
9
|
-
v = v
|
|
10
|
+
v = formatDateStr(v);
|
|
10
11
|
}
|
|
11
12
|
const date = new Date(v);
|
|
12
13
|
const o = {
|
package/es/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './filterName';
|
|
|
19
19
|
export * from './filterPhone';
|
|
20
20
|
export * from './formatAmount';
|
|
21
21
|
export * from './formatDate';
|
|
22
|
+
export * from './formatDateStr';
|
|
22
23
|
export * from './formatMessage';
|
|
23
24
|
export * from './formatPathParams';
|
|
24
25
|
export * from './getBlobByUrl';
|
package/es/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export * from './filterName';
|
|
|
20
20
|
export * from './filterPhone';
|
|
21
21
|
export * from './formatAmount';
|
|
22
22
|
export * from './formatDate';
|
|
23
|
+
export * from './formatDateStr';
|
|
23
24
|
export * from './formatMessage';
|
|
24
25
|
export * from './formatPathParams';
|
|
25
26
|
export * from './getBlobByUrl';
|
package/lib/formatDate.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatDate = void 0;
|
|
4
4
|
const isString_1 = require("./isString");
|
|
5
|
+
const formatDateStr_1 = require("./formatDateStr");
|
|
5
6
|
/**
|
|
6
7
|
* 格式化日期
|
|
7
8
|
*/
|
|
@@ -9,7 +10,7 @@ function formatDate(val, fmt = 'yyyy-MM-dd hh:mm:ss') {
|
|
|
9
10
|
let v = val;
|
|
10
11
|
if ((0, isString_1.isString)(v)) {
|
|
11
12
|
// fix iOS new Date() 不支持 2020-01-01 格式,需转换为 2020/01/01
|
|
12
|
-
v =
|
|
13
|
+
v = (0, formatDateStr_1.formatDateStr)(v);
|
|
13
14
|
}
|
|
14
15
|
const date = new Date(v);
|
|
15
16
|
const o = {
|
package/lib/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './filterName';
|
|
|
19
19
|
export * from './filterPhone';
|
|
20
20
|
export * from './formatAmount';
|
|
21
21
|
export * from './formatDate';
|
|
22
|
+
export * from './formatDateStr';
|
|
22
23
|
export * from './formatMessage';
|
|
23
24
|
export * from './formatPathParams';
|
|
24
25
|
export * from './getBlobByUrl';
|
package/lib/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __exportStar(require("./filterName"), exports);
|
|
|
36
36
|
__exportStar(require("./filterPhone"), exports);
|
|
37
37
|
__exportStar(require("./formatAmount"), exports);
|
|
38
38
|
__exportStar(require("./formatDate"), exports);
|
|
39
|
+
__exportStar(require("./formatDateStr"), exports);
|
|
39
40
|
__exportStar(require("./formatMessage"), exports);
|
|
40
41
|
__exportStar(require("./formatPathParams"), exports);
|
|
41
42
|
__exportStar(require("./getBlobByUrl"), exports);
|