native-pytech 1.0.31 → 1.0.32
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/dist/libs/constants/formats.js +11 -14
- package/package.json +1 -1
|
@@ -66,20 +66,17 @@ const phoneToText = (phone) => {
|
|
|
66
66
|
}
|
|
67
67
|
return extra ? `${base}${extra}` : base;
|
|
68
68
|
};
|
|
69
|
-
const dateToTextFormat = (date, format =
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return format
|
|
80
|
-
.replace('YYYY', year)
|
|
81
|
-
.replace('MM', month)
|
|
82
|
-
.replace('DD', day);
|
|
69
|
+
const dateToTextFormat = (date, format = 'YYYY-MM-DD') => {
|
|
70
|
+
const values = {
|
|
71
|
+
DD: String(date.getDate()).padStart(2, '0'),
|
|
72
|
+
MM: String(date.getMonth() + 1).padStart(2, '0'),
|
|
73
|
+
YYYY: String(date.getFullYear()),
|
|
74
|
+
YY: String(date.getFullYear()).slice(-2),
|
|
75
|
+
HH: String(date.getHours()).padStart(2, '0'),
|
|
76
|
+
mm: String(date.getMinutes()).padStart(2, '0'),
|
|
77
|
+
ss: String(date.getSeconds()).padStart(2, '0'),
|
|
78
|
+
};
|
|
79
|
+
return format.replace(/DD|MM|YYYY|YY|HH|mm|ss/g, match => values[match]);
|
|
83
80
|
};
|
|
84
81
|
// ------------------- Export -------------------
|
|
85
82
|
const Formats = {
|