@managesome/eposmatic-toolkit 0.2.540 → 0.2.541
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.
|
@@ -13,7 +13,7 @@ export declare function convertMilliToTime(milliseconds: number): {
|
|
|
13
13
|
minutes: number;
|
|
14
14
|
hours: number;
|
|
15
15
|
};
|
|
16
|
-
export declare function getHMS(milliseconds: number): string;
|
|
16
|
+
export declare function getHMS(milliseconds: number, showSeconds?: boolean): string;
|
|
17
17
|
export declare function fakeDelay(delay?: number): Promise<void>;
|
|
18
18
|
export declare const isValidNumber: RegExp;
|
|
19
19
|
export declare function pxToRem(value: number): string;
|
|
@@ -110,17 +110,20 @@ function convertMilliToTime(milliseconds) {
|
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
// ==============================>><<==============================
|
|
113
|
-
function getHMS(milliseconds) {
|
|
113
|
+
function getHMS(milliseconds, showSeconds) {
|
|
114
114
|
const date = new Date(milliseconds);
|
|
115
115
|
let hours = date.getUTCHours();
|
|
116
116
|
let minutes = date.getUTCMinutes();
|
|
117
|
-
|
|
117
|
+
let seconds = showSeconds ? date.getUTCSeconds() : 0;
|
|
118
118
|
if (hours < 10) {
|
|
119
119
|
hours = '0' + hours;
|
|
120
120
|
}
|
|
121
121
|
if (minutes < 10) {
|
|
122
122
|
minutes = '0' + minutes;
|
|
123
123
|
}
|
|
124
|
+
if (seconds < 10) {
|
|
125
|
+
seconds = '0' + seconds;
|
|
126
|
+
}
|
|
124
127
|
return hours + ':' + minutes + ':' + seconds;
|
|
125
128
|
}
|
|
126
129
|
// ==============================>><<==============================
|