law-common 11.3.10-beta.0 → 11.3.10-beta.1

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.
@@ -55,6 +55,7 @@ export declare class VendorTdsLiabilityEntityModel extends BaseEntityModel<Entit
55
55
  getUpdateActionVisibility(currentUser: UserEntityModel): {
56
56
  [key: string]: () => boolean;
57
57
  };
58
+ formatPeriod(formatStr: string): string;
58
59
  static derivePeriodFromDateCode({ dateCode }: {
59
60
  dateCode: number;
60
61
  }): number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VendorTdsLiabilityEntityModel = void 0;
4
+ const date_fns_1 = require("date-fns");
4
5
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
5
6
  const base_entity_model_1 = require("./base.entity.model");
6
7
  const relation_type_enum_1 = require("../enums/relation-type.enum");
@@ -187,6 +188,11 @@ class VendorTdsLiabilityEntityModel extends base_entity_model_1.BaseEntityModel
187
188
  getUpdateActionVisibility(currentUser) {
188
189
  return {};
189
190
  }
191
+ formatPeriod(formatStr) {
192
+ const year = Math.floor(this.period / 100);
193
+ const month = this.period % 100;
194
+ return (0, date_fns_1.format)(new Date(year, month - 1), formatStr);
195
+ }
190
196
  static derivePeriodFromDateCode({ dateCode }) {
191
197
  return parseInt(dateCode.toString().slice(0, 6));
192
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "11.3.10-beta.0",
3
+ "version": "11.3.10-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [