ismx-nexo-node-app 0.4.3 → 0.4.4
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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateUtils = void 0;
|
|
4
|
+
class DateUtils {
|
|
5
|
+
static getMonth(date, using = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dec']) {
|
|
6
|
+
return using[date.getMonth()];
|
|
7
|
+
}
|
|
8
|
+
static getDay(date, using = ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat']) {
|
|
9
|
+
return using[date.getDay()];
|
|
10
|
+
}
|
|
11
|
+
static toTime(date) {
|
|
12
|
+
let mins = date.getMinutes().toString().padStart(2, '0');
|
|
13
|
+
let hour = date.getHours().toString().padStart(2, '0');
|
|
14
|
+
return `${hour}:${mins}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.DateUtils = DateUtils;
|
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export abstract class DateUtils {
|
|
2
|
+
|
|
3
|
+
static getMonth(date: Date, using: string[] = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dec']) {
|
|
4
|
+
return using[date.getMonth()]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
static getDay(date: Date, using: string[] = ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat']) {
|
|
8
|
+
return using[date.getDay()]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static toTime(date:Date) {
|
|
12
|
+
let mins = date.getMinutes().toString().padStart(2, '0');
|
|
13
|
+
let hour = date.getHours().toString().padStart(2, '0');
|
|
14
|
+
return `${hour}:${mins}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|