invoice-system-common 1.0.25-beta.1 → 1.0.26
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.
|
@@ -22,5 +22,14 @@ class DateUtils {
|
|
|
22
22
|
const diff = (e.getTime() - s.getTime()) / (1000 * 60 * 60 * 24);
|
|
23
23
|
return diff;
|
|
24
24
|
}
|
|
25
|
+
formatDateDDMMYYYY(dateString) {
|
|
26
|
+
if (!/^\d{8}$/.test(dateString)) {
|
|
27
|
+
throw new Error("Invalid date format. Expected YYYYMMDD.");
|
|
28
|
+
}
|
|
29
|
+
const year = dateString.slice(0, 4);
|
|
30
|
+
const month = dateString.slice(4, 6);
|
|
31
|
+
const day = dateString.slice(6, 8);
|
|
32
|
+
return `${day}-${month}-${year}`;
|
|
33
|
+
}
|
|
25
34
|
}
|
|
26
35
|
exports.DateUtils = DateUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getDecimalNoUptoNPlaces(decimalNumber: number, n?: number): number;
|
|
1
|
+
export declare function getDecimalNoUptoNPlaces(decimalNumber: number | string, n?: number): number;
|
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDecimalNoUptoNPlaces = getDecimalNoUptoNPlaces;
|
|
4
4
|
function getDecimalNoUptoNPlaces(decimalNumber, n = 2) {
|
|
5
|
-
|
|
6
|
-
return parseFloat(decimalNumber.toFixed(n));
|
|
5
|
+
return parseFloat(Number(decimalNumber).toFixed(n));
|
|
7
6
|
}
|