law-common 10.63.2-beta.12 → 10.63.2-beta.13

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.
@@ -63,4 +63,16 @@ export declare class DateCodeModel {
63
63
  currFY: string;
64
64
  };
65
65
  static getCurrentTimestampCode(): string;
66
+ /**
67
+ * Creates a DateCodeModel instance directly from a JavaScript Date object.
68
+ * Internally formats the date to "yyyyMMdd" and constructs the model.
69
+ *
70
+ * @param date - A valid JavaScript Date object
71
+ * @returns A new DateCodeModel instance representing the given date
72
+ *
73
+ * @example
74
+ * const model = DateCodeModel.fromDateObject(new Date('2025-01-01'));
75
+ * // equivalent to: new DateCodeModel(DateCodeModel.fromDate(new Date('2025-01-01')))
76
+ */
77
+ static fromDateObject(date: Date): DateCodeModel;
66
78
  }
@@ -316,5 +316,19 @@ class DateCodeModel {
316
316
  const minutes = String(nowIST.getUTCMinutes()).padStart(2, "0");
317
317
  return `${year}${month}${day} ${hours}${minutes}`;
318
318
  }
319
+ /**
320
+ * Creates a DateCodeModel instance directly from a JavaScript Date object.
321
+ * Internally formats the date to "yyyyMMdd" and constructs the model.
322
+ *
323
+ * @param date - A valid JavaScript Date object
324
+ * @returns A new DateCodeModel instance representing the given date
325
+ *
326
+ * @example
327
+ * const model = DateCodeModel.fromDateObject(new Date('2025-01-01'));
328
+ * // equivalent to: new DateCodeModel(DateCodeModel.fromDate(new Date('2025-01-01')))
329
+ */
330
+ static fromDateObject(date) {
331
+ return new DateCodeModel(DateCodeModel.fromDate(date));
332
+ }
319
333
  }
320
334
  exports.DateCodeModel = DateCodeModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.63.2-beta.12",
3
+ "version": "10.63.2-beta.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [