@contrail/util 1.0.23 → 1.0.24
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateUtil = void 0;
|
|
4
|
+
const getIsoDatePart_1 = require("./getIsoDatePart/getIsoDatePart");
|
|
5
|
+
class DateUtil {
|
|
6
|
+
}
|
|
7
|
+
exports.DateUtil = DateUtil;
|
|
8
|
+
DateUtil.getIsoDatePart = getIsoDatePart_1.getIsoDatePart;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getIsoDatePart(date: Date): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIsoDatePart = void 0;
|
|
4
|
+
function getIsoDatePart(date) {
|
|
5
|
+
console.log('date 1: ', date.toISOString(), '\n\n\n\n\n\n\n\n');
|
|
6
|
+
let d = new Date(date);
|
|
7
|
+
console.log('date 2: ', d.toISOString(), '\n\n\n\n\n\n\n\n');
|
|
8
|
+
let month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear();
|
|
9
|
+
if (month.length < 2) {
|
|
10
|
+
month = '0' + month;
|
|
11
|
+
}
|
|
12
|
+
if (day.length < 2) {
|
|
13
|
+
day = '0' + day;
|
|
14
|
+
}
|
|
15
|
+
return [year, month, day].join('-');
|
|
16
|
+
}
|
|
17
|
+
exports.getIsoDatePart = getIsoDatePart;
|