@sphereon/ui-components.core 0.3.1-unstable.5 → 0.4.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.
@@ -6,4 +6,5 @@ export declare const DATE_FORMAT_OPTIONS: {
6
6
  };
7
7
  export declare const toLocalDateTimeString: (date: number) => string;
8
8
  export declare const toLocalDateString: (date: number) => string;
9
+ export declare const formatDate: (date: number) => number;
9
10
  export declare const makeEpochMilli: (date: number) => number;
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  exports.__esModule = true;
17
- exports.makeEpochMilli = exports.toLocalDateString = exports.toLocalDateTimeString = exports.DATE_FORMAT_OPTIONS = exports.EPOCH_MILLISECONDS = void 0;
17
+ exports.makeEpochMilli = exports.formatDate = exports.toLocalDateString = exports.toLocalDateTimeString = exports.DATE_FORMAT_OPTIONS = exports.EPOCH_MILLISECONDS = void 0;
18
18
  var Localization_1 = __importDefault(require("../localization/Localization"));
19
19
  exports.EPOCH_MILLISECONDS = 1000;
20
20
  exports.DATE_FORMAT_OPTIONS = {
@@ -23,11 +23,11 @@ exports.DATE_FORMAT_OPTIONS = {
23
23
  day: 'numeric'
24
24
  };
25
25
  var toLocalDateTimeString = function (date) {
26
- return new Date(formatDate(date)).toLocaleString(Localization_1["default"].getLocale(), __assign(__assign({}, exports.DATE_FORMAT_OPTIONS), { hour: 'numeric', minute: 'numeric', second: 'numeric' }));
26
+ return new Date((0, exports.formatDate)(date)).toLocaleString(Localization_1["default"].getLocale(), __assign(__assign({}, exports.DATE_FORMAT_OPTIONS), { hour: 'numeric', minute: 'numeric', second: 'numeric' }));
27
27
  };
28
28
  exports.toLocalDateTimeString = toLocalDateTimeString;
29
29
  var toLocalDateString = function (date) {
30
- return new Date(formatDate(date)).toLocaleDateString(Localization_1["default"].getLocale(), exports.DATE_FORMAT_OPTIONS);
30
+ return new Date((0, exports.formatDate)(date)).toLocaleDateString(Localization_1["default"].getLocale(), exports.DATE_FORMAT_OPTIONS);
31
31
  };
32
32
  exports.toLocalDateString = toLocalDateString;
33
33
  var formatDate = function (date) {
@@ -38,6 +38,7 @@ var formatDate = function (date) {
38
38
  }
39
39
  return epoch;
40
40
  };
41
+ exports.formatDate = formatDate;
41
42
  var makeEpochMilli = function (date) {
42
43
  if (!isEpochMilli(date)) {
43
44
  date = date * exports.EPOCH_MILLISECONDS;
@@ -49,7 +50,7 @@ var isEpochMilli = function (date) {
49
50
  return date.toString().length > 10;
50
51
  };
51
52
  var removeFractionalPart = function (date) {
52
- if (date.toString().includes('.')) {
53
+ if (date.toString().indexOf('.') >= 0) {
53
54
  return Number(date.toString().split('.')[0]);
54
55
  }
55
56
  return date;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sphereon/ui-components.core",
3
3
  "private": false,
4
- "version": "0.3.1-unstable.5+14fb900",
4
+ "version": "0.4.0",
5
5
  "description": "SSI UI components Core",
6
6
  "repository": "git@github.com:Sphereon-Opensource/UI-Components.git",
7
7
  "author": "Sphereon <dev@sphereon.com>",
@@ -39,7 +39,7 @@
39
39
  "typescript": "4.9.5"
40
40
  },
41
41
  "peerDependencies": {
42
- "react": ">= 18"
42
+ "react": ">= 18.2"
43
43
  },
44
- "gitHead": "14fb900e9a7fffa91ed70500402d470afa5aa5b3"
44
+ "gitHead": "c63b21ea1ff8a2aef0b6de301d1a85143d9d8f8e"
45
45
  }