@trackunit/shared-utils 0.0.57 → 0.0.59-alpha-26d41cfe4c9.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/index.cjs.js CHANGED
@@ -10,19 +10,36 @@ exports.HoursAndMinutesFormat = void 0;
10
10
  HoursAndMinutesFormat["HOURS_MIN"] = "HOURS_MIN";
11
11
  HoursAndMinutesFormat["HOURS_LONG"] = "HOURS_LONG";
12
12
  })(exports.HoursAndMinutesFormat || (exports.HoursAndMinutesFormat = {}));
13
- exports.DateTimeFormat = void 0;
14
- (function (DateTimeFormat) {
15
- DateTimeFormat["DATE"] = "L";
16
- DateTimeFormat["DATE_LONG"] = "LL";
17
- DateTimeFormat["DATE_LONG_TIME"] = "LLL";
18
- DateTimeFormat["DATE_SHORT"] = "ll";
19
- DateTimeFormat["DATE_SHORT_TIME"] = "lll";
20
- DateTimeFormat["TIME_SHORT"] = "LT";
21
- DateTimeFormat["TIME_LONG"] = "LTS";
22
- DateTimeFormat["YEAR"] = "YYYY";
23
- DateTimeFormat["YEAR_MONTH_DAY"] = "yyyy-MM-DD";
24
- DateTimeFormat["MONTH_DAY"] = "MMM, Do";
25
- })(exports.DateTimeFormat || (exports.DateTimeFormat = {}));
13
+ const DateTimeFormat = {
14
+ DATE: {
15
+ selectFormat: "dateOnly",
16
+ dateFormat: "short",
17
+ },
18
+ DATE_LONG: {
19
+ selectFormat: "dateOnly",
20
+ dateFormat: "long",
21
+ },
22
+ DATE_LONG_TIME: {
23
+ dateFormat: "long",
24
+ timeFormat: "short",
25
+ },
26
+ DATE_SHORT: {
27
+ selectFormat: "dateOnly",
28
+ dateFormat: "medium",
29
+ },
30
+ DATE_SHORT_TIME: {
31
+ dateFormat: "medium",
32
+ timeFormat: "short",
33
+ },
34
+ TIME_SHORT: {
35
+ selectFormat: "timeOnly",
36
+ timeFormat: "short",
37
+ },
38
+ TIME_LONG: {
39
+ selectFormat: "timeOnly",
40
+ timeFormat: "medium",
41
+ },
42
+ };
26
43
 
27
44
  /**
28
45
  * @description Converts a date to a string in ISO format.
@@ -1064,6 +1081,7 @@ const isSorted = (sortInput) => {
1064
1081
  return originalKeys.every((key, index) => key === sortedKeys[index]);
1065
1082
  };
1066
1083
 
1084
+ exports.DateTimeFormat = DateTimeFormat;
1067
1085
  exports.align = align;
1068
1086
  exports.alphabeticallySort = alphabeticallySort;
1069
1087
  exports.arrayLengthCompare = arrayLengthCompare;
package/index.esm.js CHANGED
@@ -6,19 +6,36 @@ var HoursAndMinutesFormat;
6
6
  HoursAndMinutesFormat["HOURS_MIN"] = "HOURS_MIN";
7
7
  HoursAndMinutesFormat["HOURS_LONG"] = "HOURS_LONG";
8
8
  })(HoursAndMinutesFormat || (HoursAndMinutesFormat = {}));
9
- var DateTimeFormat;
10
- (function (DateTimeFormat) {
11
- DateTimeFormat["DATE"] = "L";
12
- DateTimeFormat["DATE_LONG"] = "LL";
13
- DateTimeFormat["DATE_LONG_TIME"] = "LLL";
14
- DateTimeFormat["DATE_SHORT"] = "ll";
15
- DateTimeFormat["DATE_SHORT_TIME"] = "lll";
16
- DateTimeFormat["TIME_SHORT"] = "LT";
17
- DateTimeFormat["TIME_LONG"] = "LTS";
18
- DateTimeFormat["YEAR"] = "YYYY";
19
- DateTimeFormat["YEAR_MONTH_DAY"] = "yyyy-MM-DD";
20
- DateTimeFormat["MONTH_DAY"] = "MMM, Do";
21
- })(DateTimeFormat || (DateTimeFormat = {}));
9
+ const DateTimeFormat = {
10
+ DATE: {
11
+ selectFormat: "dateOnly",
12
+ dateFormat: "short",
13
+ },
14
+ DATE_LONG: {
15
+ selectFormat: "dateOnly",
16
+ dateFormat: "long",
17
+ },
18
+ DATE_LONG_TIME: {
19
+ dateFormat: "long",
20
+ timeFormat: "short",
21
+ },
22
+ DATE_SHORT: {
23
+ selectFormat: "dateOnly",
24
+ dateFormat: "medium",
25
+ },
26
+ DATE_SHORT_TIME: {
27
+ dateFormat: "medium",
28
+ timeFormat: "short",
29
+ },
30
+ TIME_SHORT: {
31
+ selectFormat: "timeOnly",
32
+ timeFormat: "short",
33
+ },
34
+ TIME_LONG: {
35
+ selectFormat: "timeOnly",
36
+ timeFormat: "medium",
37
+ },
38
+ };
22
39
 
23
40
  /**
24
41
  * @description Converts a date to a string in ISO format.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@trackunit/shared-utils",
3
- "version": "0.0.57",
3
+ "version": "0.0.59-alpha-26d41cfe4c9.0",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
- "node": ">=18.x"
7
+ "node": ">=20.x"
8
8
  },
9
9
  "dependencies": {},
10
10
  "module": "./index.esm.js",
@@ -5,17 +5,36 @@ export declare enum HoursAndMinutesFormat {
5
5
  HOURS_MIN = "HOURS_MIN",// h[h] m[m]
6
6
  HOURS_LONG = "HOURS_LONG"
7
7
  }
8
- export type HoursAndMinutesFormatType = `${HoursAndMinutesFormat}`;
9
- export declare enum DateTimeFormat {
10
- DATE = "L",
11
- DATE_LONG = "LL",
12
- DATE_LONG_TIME = "LLL",
13
- DATE_SHORT = "ll",
14
- DATE_SHORT_TIME = "lll",
15
- TIME_SHORT = "LT",
16
- TIME_LONG = "LTS",
17
- YEAR = "YYYY",
18
- YEAR_MONTH_DAY = "yyyy-MM-DD",
19
- MONTH_DAY = "MMM, Do"
20
- }
21
- export type DateTimeFormatType = `${DateTimeFormat}`;
8
+ export declare const DateTimeFormat: {
9
+ readonly DATE: {
10
+ readonly selectFormat: "dateOnly";
11
+ readonly dateFormat: "short";
12
+ };
13
+ readonly DATE_LONG: {
14
+ readonly selectFormat: "dateOnly";
15
+ readonly dateFormat: "long";
16
+ };
17
+ readonly DATE_LONG_TIME: {
18
+ readonly dateFormat: "long";
19
+ readonly timeFormat: "short";
20
+ };
21
+ readonly DATE_SHORT: {
22
+ readonly selectFormat: "dateOnly";
23
+ readonly dateFormat: "medium";
24
+ };
25
+ readonly DATE_SHORT_TIME: {
26
+ readonly dateFormat: "medium";
27
+ readonly timeFormat: "short";
28
+ };
29
+ readonly TIME_SHORT: {
30
+ readonly selectFormat: "timeOnly";
31
+ readonly timeFormat: "short";
32
+ };
33
+ readonly TIME_LONG: {
34
+ readonly selectFormat: "timeOnly";
35
+ readonly timeFormat: "medium";
36
+ };
37
+ };
38
+ type DateTimeFormatKey = keyof typeof DateTimeFormat;
39
+ export type DateTimeFormatType = (typeof DateTimeFormat)[DateTimeFormatKey];
40
+ export {};