not-bulma 1.0.26 → 1.0.27

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/notBulma.js CHANGED
@@ -7636,6 +7636,23 @@ var notBulma = (function (exports) {
7636
7636
  return `${this.MONEY_SIGN}${major}.${minor}`;
7637
7637
  }
7638
7638
 
7639
+ static formatLocaleDatetime(dt) {
7640
+ const date = dt.toLocaleDateString(window.navigator.language);
7641
+ const time = dt.toLocaleTimeString(window.navigator.language);
7642
+ return `${date} ${time}`;
7643
+ }
7644
+
7645
+ static tryFormatLocaleDateTime(value) {
7646
+ if (typeof value == 'string') {
7647
+ const dt = new Date(value);
7648
+ return UICommon.formatLocaleDatetime(dt);
7649
+ } else if (typeof value == 'object') {
7650
+ return UICommon.formatLocaleDatetime(value);
7651
+ } else {
7652
+ return '';
7653
+ }
7654
+ }
7655
+
7639
7656
  static formatTimestamp(timestamp) {
7640
7657
  let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
7641
7658
  let offsetLocal = new Date().getTimezoneOffset();
@@ -10249,19 +10266,28 @@ var notBulma = (function (exports) {
10249
10266
  // (52:4) {#if readonly }
10250
10267
  function create_if_block$v(ctx) {
10251
10268
  let p;
10269
+ let time;
10270
+ let t_value = UICommon.tryFormatLocaleDateTime(/*value*/ ctx[0]) + "";
10252
10271
  let t;
10253
10272
 
10254
10273
  return {
10255
10274
  c() {
10256
10275
  p = element("p");
10257
- t = text(/*value*/ ctx[0]);
10276
+ time = element("time");
10277
+ t = text(t_value);
10278
+ attr(time, "datetime", /*value*/ ctx[0]);
10258
10279
  },
10259
10280
  m(target, anchor) {
10260
10281
  insert(target, p, anchor);
10261
- append(p, t);
10282
+ append(p, time);
10283
+ append(time, t);
10262
10284
  },
10263
10285
  p(ctx, dirty) {
10264
- if (dirty & /*value*/ 1) set_data(t, /*value*/ ctx[0]);
10286
+ if (dirty & /*value*/ 1 && t_value !== (t_value = UICommon.tryFormatLocaleDateTime(/*value*/ ctx[0]) + "")) set_data(t, t_value);
10287
+
10288
+ if (dirty & /*value*/ 1) {
10289
+ attr(time, "datetime", /*value*/ ctx[0]);
10290
+ }
10265
10291
  },
10266
10292
  d(detaching) {
10267
10293
  if (detaching) detach(p);