@budibase/bbui 1.0.135 → 1.0.138

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "1.0.135",
4
+ "version": "1.0.138",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "^1.2.1",
41
- "@budibase/string-templates": "^1.0.135",
41
+ "@budibase/string-templates": "^1.0.138",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -84,5 +84,5 @@
84
84
  "svelte-flatpickr": "^3.2.3",
85
85
  "svelte-portal": "^1.0.0"
86
86
  },
87
- "gitHead": "eae6a0110baea43dc1d735dc2d7db36732d52da7"
87
+ "gitHead": "fed8c77bce51a555cf057df219b913e66467442e"
88
88
  }
@@ -2,17 +2,22 @@
2
2
  import dayjs from "dayjs"
3
3
 
4
4
  export let value
5
+ export let schema
5
6
 
6
7
  // adding the 0- will turn a string like 00:00:00 into a valid ISO
7
8
  // date, but will make actual ISO dates invalid
8
9
  $: time = new Date(`0-${value}`)
9
- $: isTime = !isNaN(time)
10
+ $: isTimeOnly = !isNaN(time) || schema?.timeOnly
11
+ $: isDateOnly = schema?.dateOnly
12
+ $: format = isTimeOnly
13
+ ? "HH:mm:ss"
14
+ : isDateOnly
15
+ ? "MMMM D YYYY"
16
+ : "MMMM D YYYY, HH:mm"
10
17
  </script>
11
18
 
12
19
  <div>
13
- {dayjs(isTime ? time : value).format(
14
- isTime ? "HH:mm:ss" : "MMMM D YYYY, HH:mm"
15
- )}
20
+ {dayjs(isTimeOnly ? time : value).format(format)}
16
21
  </div>
17
22
 
18
23
  <style>