@conduction/nextcloud-vue 0.1.0-beta.16 → 0.1.0-beta.17

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/nextcloud-vue",
3
- "version": "0.1.0-beta.16",
3
+ "version": "0.1.0-beta.17",
4
4
  "description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
5
5
  "license": "EUPL-1.2",
6
6
  "author": "Conduction B.V. <info@conduction.nl>",
@@ -551,6 +551,15 @@ export default {
551
551
  datetimeValue() {
552
552
  const v = this.value
553
553
  if (!v) return null
554
+ // Date-only strings (YYYY-MM-DD) are parsed as UTC midnight by the spec,
555
+ // which shifts to the previous day in positive-UTC-offset timezones when
556
+ // fed to a picker that renders in local time. Parse them as local midnight.
557
+ if (this.schemaProp?.format === 'date'
558
+ && typeof v === 'string'
559
+ && /^\d{4}-\d{2}-\d{2}$/.test(v)) {
560
+ const [year, month, day] = v.split('-').map(Number)
561
+ return new Date(year, month - 1, day)
562
+ }
554
563
  const d = new Date(v)
555
564
  return Number.isNaN(d.getTime()) ? null : d
556
565
  },
@@ -594,6 +603,11 @@ export default {
594
603
  const v = this.value
595
604
  if (!v) return ''
596
605
  const fmt = this.schemaProp?.format
606
+ // Same local-midnight parse as datetimeValue to avoid UTC-shift in display.
607
+ if (fmt === 'date' && typeof v === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(v)) {
608
+ const [year, month, day] = v.split('-').map(Number)
609
+ return new Date(year, month - 1, day).toLocaleDateString()
610
+ }
597
611
  const d = new Date(v)
598
612
  if (Number.isNaN(d.getTime())) return String(v)
599
613
  if (fmt === 'date') return d.toLocaleDateString()
@@ -663,7 +677,12 @@ export default {
663
677
  }
664
678
  const fmt = this.schemaProp?.format
665
679
  if (fmt === 'date') {
666
- this.$emit('update:value', date.toISOString().slice(0, 10))
680
+ // Use local-time accessors — toISOString() converts to UTC first,
681
+ // which shifts midnight local time to the previous day in UTC+n zones.
682
+ const year = date.getFullYear()
683
+ const month = String(date.getMonth() + 1).padStart(2, '0')
684
+ const day = String(date.getDate()).padStart(2, '0')
685
+ this.$emit('update:value', `${year}-${month}-${day}`)
667
686
  return
668
687
  }
669
688
  if (fmt === 'time') {