@budibase/bbui 3.8.1 → 3.8.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/dist/bbui.mjs CHANGED
@@ -28086,7 +28086,7 @@ const capitalise = (f) => f ? f.substring(0, 1).toUpperCase() + f.substring(1) :
28086
28086
  default:
28087
28087
  return console.log("Unsupported date part", f), "";
28088
28088
  }
28089
- }, localeDateFormat = new Intl.DateTimeFormat().formatToParts(/* @__PURE__ */ new Date("2021-01-01")).map(getPatternForPart).join(""), getDateDisplayValue = (f, { enableTime: u = !0, timeOnly: p = !1 } = {}) => f != null && f.isValid() ? p ? f.format("HH:mm") : u ? f.format(`${localeDateFormat} HH:mm`) : f.format(localeDateFormat) : "", hexToRGBA = (f, u) => {
28089
+ }, localeDateFormat = new Intl.DateTimeFormat().formatToParts(/* @__PURE__ */ new Date("2021-01-01")).map(getPatternForPart).join(""), getDateDisplayValue = (f, { enableTime: u = !0, timeOnly: p = !1 } = {}) => (typeof f == "string" && (f = dayjs(f)), f != null && f.isValid() ? p ? f.format("HH:mm") : u ? f.format(`${localeDateFormat} HH:mm`) : f.format(localeDateFormat) : ""), hexToRGBA = (f, u) => {
28090
28090
  f.includes("#") && (f = f.replace("#", ""));
28091
28091
  const p = parseInt(f.substring(0, 2), 16), m = parseInt(f.substring(2, 4), 16), v = parseInt(f.substring(4, 6), 16);
28092
28092
  return `rgba(${p}, ${m}, ${v}, ${u})`;
@@ -63545,9 +63545,9 @@ var rng_1 = Object.defineProperty({ default: _default }, "__esModule", { value:
63545
63545
  function L(x) {
63546
63546
  return x && x.__esModule ? x : { default: x };
63547
63547
  }
63548
- }), uuid_1 = createCommonjsModule(function(f) {
63548
+ }), uuid$1 = commonjsBrowser, uuid_1 = createCommonjsModule(function(f) {
63549
63549
  f.exports.uuid = function() {
63550
- return commonjsBrowser.v4();
63550
+ return uuid$1.v4();
63551
63551
  };
63552
63552
  }), lib = { array: array$1, code, collection, comparison: comparison$1, html: html_1, i18n, inflection, match, math: math$1, misc, number: number$1, object: object$1, path: path_1, regex: regex$2, string: string$1, url: url_1, uuid: uuid_1 }, handlebarsHelpers = createCommonjsModule(function(f) {
63553
63553
  f.exports = function(u, p) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "3.8.1",
4
+ "version": "3.8.2",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.ts",
7
7
  "module": "dist/bbui.mjs",
@@ -99,5 +99,5 @@
99
99
  }
100
100
  }
101
101
  },
102
- "gitHead": "83252b200ac59f338be6101f148966b2ed8ec83e"
102
+ "gitHead": "de9bbc8e465a6c939bf23c2fde11a4ce80cbc709"
103
103
  }
package/src/helpers.ts CHANGED
@@ -211,9 +211,12 @@ const localeDateFormat = new Intl.DateTimeFormat()
211
211
 
212
212
  // Formats a dayjs date according to schema flags
213
213
  export const getDateDisplayValue = (
214
- value: dayjs.Dayjs | null,
214
+ value: dayjs.Dayjs | string | null,
215
215
  { enableTime = true, timeOnly = false } = {}
216
216
  ): string => {
217
+ if (typeof value === "string") {
218
+ value = dayjs(value)
219
+ }
217
220
  if (!value?.isValid()) {
218
221
  return ""
219
222
  }