@trackunit/date-and-time-utils 0.0.2 → 0.0.4

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": "@trackunit/date-and-time-utils",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,6 +9,7 @@
9
9
  "module": "./index.esm.js",
10
10
  "main": "./index.cjs.js",
11
11
  "dependencies": {
12
+ "@formatjs/intl-enumerator": "1.3.4",
12
13
  "@js-temporal/polyfill": "0.4.3"
13
14
  },
14
15
  "peerDependencies": {}
@@ -787,4 +787,28 @@ export declare const toZonedDateTimeUtil: (date: TemporalDate, timeZoneId?: stri
787
787
  * Output: "A"
788
788
  */
789
789
  export declare const monthNameUtil: (date: TemporalDate, format: TemporalFormatStyle, locale?: string) => string;
790
+ /**
791
+ * Returns the day name for the given date.
792
+ *
793
+ * @param {TemporalDate | Date} date - The temporal or JavaScript Date object to get day name from.
794
+ * @param {TemporalFormatStyle} [format] - The format options for the name of the day.
795
+ * @param {string} [locale] - The locale to use for formatting. If not provided, the system's default locale will be used.
796
+ * @returns {string} The the name of the day from passed date.
797
+ * @example
798
+ * const dateString = "2023-04-10"
799
+ * const date = new Date(dateString);
800
+ * const dayName = dayNameUtil(date, "long");
801
+ * Output: "Monday"
802
+ * @example
803
+ * const dateString = "2023-04-10"
804
+ * const date = new Date(dateString);
805
+ * const dayName = dayNameUtil(date, "short");
806
+ * Output: "Mon"
807
+ * @example
808
+ * const dateString = "2023-04-10"
809
+ * const date = new Date(dateString);
810
+ * const dayName = dayNameUtil(date, "narrow");
811
+ * Output: "M"
812
+ */
813
+ export declare const dayNameUtil: (date: TemporalDate, format: TemporalFormatStyle, locale?: string) => string;
790
814
  export {};