ia-common 1.0.1-beta.30 → 1.0.1-beta.32

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.
package/build/@type.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./interface/modify.interface";
8
8
  export * from "./interface/update-user-info.interface";
9
9
  export * from "./interface/user-entity-without-password.interface";
10
10
  export * from "./interface/pricing-plan-model.interface";
11
+ export * from "./interface/ng-date-struct.interface";
package/build/@type.js CHANGED
@@ -24,4 +24,4 @@ __exportStar(require("./interface/modify.interface"), exports);
24
24
  __exportStar(require("./interface/update-user-info.interface"), exports);
25
25
  __exportStar(require("./interface/user-entity-without-password.interface"), exports);
26
26
  __exportStar(require("./interface/pricing-plan-model.interface"), exports);
27
- // export * from "./interface/ng-date-struct.interface";
27
+ __exportStar(require("./interface/ng-date-struct.interface"), exports);
@@ -1,7 +1,7 @@
1
1
  import { IModifyEntity, IOrganizationWithOwners, IRegistrationEntity, ISubscriptionEntity } from "../../@type";
2
2
  export interface IGetRegistrationResponse {
3
3
  [registrationId: string]: {
4
- registration: IRegistrationEntity;
4
+ registration: IModifyEntity<IRegistrationEntity>;
5
5
  organization: {
6
6
  [id: string]: IOrganizationWithOwners;
7
7
  };
@@ -0,0 +1,5 @@
1
+ export interface INgbDateStruct {
2
+ year: number;
3
+ month: number;
4
+ day: number;
5
+ }
@@ -1,5 +1,2 @@
1
- // export interface INgbDateStruct {
2
- // year: number;
3
- // month: number;
4
- // day: number;
5
- // }
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ import { INgbDateStruct } from "../@type";
1
2
  export declare class DateUtil {
2
3
  static isValidDate(dateCode: string): boolean;
3
4
  getDateCode(date: Date): string;
@@ -5,5 +6,7 @@ export declare class DateUtil {
5
6
  convertStringToDate(dateString: string, format?: string): Date;
6
7
  addNDaysToDate(date: Date, n: number): Date;
7
8
  addNDaysToDateCode(dateCode: string, n: number): string;
9
+ convertMonthsToNumber: (months: INgbDateStruct) => string;
10
+ convertNumberToNgbDateStruct: (numericDate: string) => INgbDateStruct | null;
8
11
  }
9
12
  export declare const dateUtil: DateUtil;
@@ -2,9 +2,26 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dateUtil = exports.DateUtil = void 0;
4
4
  var date_fns_1 = require("date-fns");
5
- // import { INgbDateStruct } from "../@type";
6
5
  var DateUtil = /** @class */ (function () {
7
6
  function DateUtil() {
7
+ this.convertMonthsToNumber = function (months) {
8
+ var year = months.year.toString().slice(2, 4);
9
+ var month = months.month.toString().padStart(2, "0");
10
+ var day = months.day.toString().padStart(2, "0");
11
+ var dates = year.concat(month).concat(day);
12
+ return "".concat(dates);
13
+ };
14
+ this.convertNumberToNgbDateStruct = function (numericDate) {
15
+ if (typeof numericDate === "string" && numericDate.length === 6) {
16
+ var year = parseInt(numericDate.slice(0, 2), 10);
17
+ var month = parseInt(numericDate.slice(2, 4), 10);
18
+ var day = parseInt(numericDate.slice(4, 6), 10);
19
+ if (!isNaN(year) && !isNaN(month) && !isNaN(day)) {
20
+ return { year: 2000 + year, month: month, day: day };
21
+ }
22
+ }
23
+ return null;
24
+ };
8
25
  }
9
26
  DateUtil.isValidDate = function (dateCode) {
10
27
  if (dateCode.length !== 6)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia-common",
3
- "version": "1.0.1-beta.30",
3
+ "version": "1.0.1-beta.32",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",