@onecx/accelerator 5.13.0 → 5.15.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onecx/accelerator",
3
- "version": "5.13.0",
3
+ "version": "5.15.0",
4
4
  "license": "Apache-2.0",
5
5
  "peerDependencies": {
6
6
  "tslib": "^2.6.3",
@@ -1 +1,8 @@
1
1
  export declare function isValidDate(value: any): value is Date;
2
+ /**
3
+ * This function removes time info from a JS DateTime Object and returns
4
+ * the local date as a correct UTC Date
5
+ * @param date a date-time Date object
6
+ * @returns the date without time / timezone issues
7
+ */
8
+ export declare function getUTCDateWithoutTimezoneIssues(date: Date): Date;
@@ -1,7 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidDate = isValidDate;
4
+ exports.getUTCDateWithoutTimezoneIssues = getUTCDateWithoutTimezoneIssues;
4
5
  function isValidDate(value) {
5
6
  return value instanceof Date && !isNaN(value);
6
7
  }
8
+ /**
9
+ * This function removes time info from a JS DateTime Object and returns
10
+ * the local date as a correct UTC Date
11
+ * @param date a date-time Date object
12
+ * @returns the date without time / timezone issues
13
+ */
14
+ function getUTCDateWithoutTimezoneIssues(date) {
15
+ return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0));
16
+ }
7
17
  //# sourceMappingURL=date.utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.utils.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/utils/date.utils.ts"],"names":[],"mappings":";;AAAA,kCAEG;AAFH,SAAgB,WAAW,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,KAAY,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"date.utils.js","sourceRoot":"","sources":["../../../../../../libs/accelerator/src/lib/utils/date.utils.ts"],"names":[],"mappings":";;AAAA,kCAEC;AAQD,0EAEC;AAZD,SAAgB,WAAW,CAAC,KAAU;IACpC,OAAO,KAAK,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,KAAY,CAAC,CAAA;AACtD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,+BAA+B,CAAC,IAAU;IACxD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACzF,CAAC"}