@aurodesignsystem/auro-library 5.0.1 → 5.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Semantic Release Automated Changelog
2
2
 
3
+ ## [5.0.2](https://github.com/AlaskaAirlines/auro-library/compare/v5.0.1...v5.0.2) (2025-06-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add optional locale to get date string from a specific locale instead of the users locale ([dc188c1](https://github.com/AlaskaAirlines/auro-library/commit/dc188c15c10bcde4bec30284838b4f2866c78b01))
9
+
3
10
  ## [5.0.1](https://github.com/AlaskaAirlines/auro-library/compare/v5.0.0...v5.0.1) (2025-06-02)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem/auro-library",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "This repository holds shared scripts, utilities, and workflows utilized across repositories along the Auro Design System.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,9 +54,10 @@ class DateFormatter {
54
54
  /**
55
55
  * Convert a date object to string format.
56
56
  * @param {Object} date - Date to convert to string.
57
- * @returns {Object} Returns the date as a string.
57
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
58
+ * @returns {String} Returns the date as a string.
58
59
  */
59
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
60
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
60
61
  year: "numeric",
61
62
  month: "2-digit",
62
63
  day: "2-digit",
@@ -81,7 +81,7 @@ export class AuroDateUtilities extends AuroDateUtilitiesBase {
81
81
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
82
82
 
83
83
  // Get the date string of the date object we created from the string date
84
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
84
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
85
85
 
86
86
  // Guard Clause: Generated date matches date string input
87
87
  if (expectedDateStr !== actualDateStr) {