@contrail/util 1.0.22 → 1.0.25

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.
@@ -0,0 +1,4 @@
1
+ import { getIsoDatePart } from "./getIsoDatePart/getIsoDatePart";
2
+ export declare class DateUtil {
3
+ static getIsoDatePart: typeof getIsoDatePart;
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DateUtil = void 0;
4
+ const getIsoDatePart_1 = require("./getIsoDatePart/getIsoDatePart");
5
+ class DateUtil {
6
+ }
7
+ exports.DateUtil = DateUtil;
8
+ DateUtil.getIsoDatePart = getIsoDatePart_1.getIsoDatePart;
@@ -0,0 +1 @@
1
+ export declare function getIsoDatePart(date: Date): string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIsoDatePart = void 0;
4
+ function getIsoDatePart(date) {
5
+ console.log('date 1: ', date.toISOString(), '\n\n\n\n\n\n\n\n');
6
+ let d = new Date(date);
7
+ console.log('date 2: ', d.toISOString(), '\n\n\n\n\n\n\n\n');
8
+ let month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear();
9
+ if (month.length < 2) {
10
+ month = '0' + month;
11
+ }
12
+ if (day.length < 2) {
13
+ day = '0' + day;
14
+ }
15
+ return [year, month, day].join('-');
16
+ }
17
+ exports.getIsoDatePart = getIsoDatePart;
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './object-util/object-util';
2
2
  export * from './string-util/string-util';
3
+ export * from './date-util/date-util';
package/lib/index.js CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./object-util/object-util"), exports);
18
18
  __exportStar(require("./string-util/string-util"), exports);
19
+ __exportStar(require("./date-util/date-util"), exports);
@@ -12,5 +12,5 @@ export declare class ObjectUtil {
12
12
  static cloneDeep: typeof cloneDeep;
13
13
  static compareDeep: typeof getObjectDiffs;
14
14
  static applyChangesIfEqual: typeof applyChangesIfEqual;
15
- static determinChangesIfEqual: typeof determineChangesIfEqual;
15
+ static determineChangesIfEqual: typeof determineChangesIfEqual;
16
16
  }
@@ -40,4 +40,4 @@ ObjectUtil.mergeDeep = mergeDeep_1.mergeDeep;
40
40
  ObjectUtil.cloneDeep = cloneDeep_1.cloneDeep;
41
41
  ObjectUtil.compareDeep = compareDeep_1.getObjectDiffs;
42
42
  ObjectUtil.applyChangesIfEqual = applyChangesIfEqual_1.applyChangesIfEqual;
43
- ObjectUtil.determinChangesIfEqual = applyChangesIfEqual_1.determineChangesIfEqual;
43
+ ObjectUtil.determineChangesIfEqual = applyChangesIfEqual_1.determineChangesIfEqual;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/util",
3
- "version": "1.0.22",
3
+ "version": "1.0.25",
4
4
  "description": "General javascript utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",