@leapdevuk/component-toolbox 0.0.124 → 0.0.126

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/dist/index.es.js CHANGED
@@ -8224,9 +8224,11 @@ const te = (e, r, t, n, a) => {
8224
8224
  t && typeof e == "string" ? e.replace(" ", "T").replace("Z", "").concat("Z") : e,
8225
8225
  `${r.formatLong.date({ width: "short" })}${n ? "" : o}`
8226
8226
  ) : "";
8227
- }, i2 = (e, r = "en-GB") => {
8227
+ }, i2 = (e, r) => {
8228
8228
  if (!e)
8229
8229
  return console.warn("formatReportDate called with null or undefined date."), "";
8230
+ if (!r)
8231
+ return console.warn("formatReportDate called with undefined locale."), "";
8230
8232
  if (typeof e == "string" && e.includes("T")) {
8231
8233
  const t = new Date(e);
8232
8234
  if (isNaN(t.getTime()))
@@ -8236,7 +8238,7 @@ const te = (e, r, t, n, a) => {
8236
8238
  const t = e.split("-");
8237
8239
  if (t.length !== 3 || t.some((n) => isNaN(Number(n))))
8238
8240
  return console.warn(`Invalid date string format: ${e}`), "";
8239
- r === "en-US" ? e = `${t[1]}-${t[2]}-${t[0]}` : e = `${t[2]}-${t[1]}-${t[0]}`;
8241
+ r.code === "en-US" ? e = `${t[1]}-${t[2]}-${t[0]}` : e = `${t[2]}-${t[1]}-${t[0]}`;
8240
8242
  }
8241
8243
  return e;
8242
8244
  }, it = (e) => {