@trackunit/date-and-time-utils 0.0.6 → 0.0.8

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/index.cjs.js CHANGED
@@ -12,7 +12,9 @@ const Polyfill = require("@formatjs/intl-enumerator");
12
12
  * @returns {string[]}
13
13
  */
14
14
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
15
- const timeZonesAvailable = Intl.supportedValuesOf ? Intl.supportedValuesOf("timeZone") : Polyfill.supportedValuesOf("timeZone");
15
+ const timeZonesAvailable = Intl.supportedValuesOf
16
+ ? Intl.supportedValuesOf("timeZone")
17
+ : Polyfill.supportedValuesOf("timeZone");
16
18
  /**
17
19
  * Formats a temporal date according to the specified format, time zone, and locale.
18
20
  *
@@ -961,7 +963,7 @@ const toZonedDateTimeUtil = (date, timeZoneId, calendar) => {
961
963
  }
962
964
  return date.toZonedDateTime({
963
965
  calendar: polyfill.Temporal.Calendar.from(calendar !== null && calendar !== void 0 ? calendar : "iso8601"),
964
- timeZone: polyfill.Temporal.TimeZone.from(timeZoneId !== null && timeZoneId !== void 0 ? timeZoneId : polyfill.Temporal.Now.timeZone().id),
966
+ timeZone: polyfill.Temporal.TimeZone.from(timeZoneId !== null && timeZoneId !== void 0 ? timeZoneId : polyfill.Temporal.Now.timeZoneId()),
965
967
  });
966
968
  };
967
969
  /**
package/index.esm.js CHANGED
@@ -8,7 +8,9 @@ const Polyfill = require("@formatjs/intl-enumerator");
8
8
  * @returns {string[]}
9
9
  */
10
10
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
11
- const timeZonesAvailable = Intl.supportedValuesOf ? Intl.supportedValuesOf("timeZone") : Polyfill.supportedValuesOf("timeZone");
11
+ const timeZonesAvailable = Intl.supportedValuesOf
12
+ ? Intl.supportedValuesOf("timeZone")
13
+ : Polyfill.supportedValuesOf("timeZone");
12
14
  /**
13
15
  * Formats a temporal date according to the specified format, time zone, and locale.
14
16
  *
@@ -957,7 +959,7 @@ const toZonedDateTimeUtil = (date, timeZoneId, calendar) => {
957
959
  }
958
960
  return date.toZonedDateTime({
959
961
  calendar: Temporal.Calendar.from(calendar !== null && calendar !== void 0 ? calendar : "iso8601"),
960
- timeZone: Temporal.TimeZone.from(timeZoneId !== null && timeZoneId !== void 0 ? timeZoneId : Temporal.Now.timeZone().id),
962
+ timeZone: Temporal.TimeZone.from(timeZoneId !== null && timeZoneId !== void 0 ? timeZoneId : Temporal.Now.timeZoneId()),
961
963
  });
962
964
  };
963
965
  /**
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@trackunit/date-and-time-utils",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=18.x"
8
8
  },
9
9
  "dependencies": {
10
- "@formatjs/intl-enumerator": "^1.4.0",
11
- "@js-temporal/polyfill": "^0.4.3"
10
+ "@formatjs/intl-enumerator": "^1.4.1",
11
+ "@js-temporal/polyfill": "^0.4.4"
12
12
  },
13
13
  "module": "./index.esm.js",
14
14
  "main": "./index.cjs.js"