invoice-system-common 1.0.25-beta.2 → 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.
@@ -3,4 +3,5 @@ export declare class DateUtils {
3
3
  formatDateYYYYMMDD(dateString: string): string;
4
4
  getDaysInMonthFromYYYYMMDD(dateString: string): number;
5
5
  getDaysBetween(start: string, end: string): number;
6
+ formatDateDDMMYYYY(dateString: string): string;
6
7
  }
@@ -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;
@@ -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
- console.log("decimalNumber", typeof decimalNumber);
6
5
  return parseFloat(Number(decimalNumber).toFixed(n));
7
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "invoice-system-common",
3
- "version": "1.0.25-beta.2",
3
+ "version": "1.0.26",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/Kashyap2210/invoice-system-common#readme",
6
6
  "bugs": {