Skip to content

Commit fbb21ea

Browse files
committed
chore: remove provisional fix for date and time input.
The underlying issue was resolved in @nextcloud/vue@9.10 Resolves #8307 Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
1 parent e047346 commit fbb21ea

3 files changed

Lines changed: 0 additions & 79 deletions

File tree

package-lock.json

Lines changed: 0 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"color-string": "^2.1.4",
6767
"core-js": "^3.50.0",
6868
"css-color-names": "^1.0.1",
69-
"datetime-locale-patterns": "^1.0.2",
7069
"debounce": "^3.0.0",
7170
"linkifyjs": "^4.3.3",
7271
"md5": "^2.3.0",

src/components/Shared/DatePicker.vue

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,24 @@
44
-->
55

66
<template>
7-
<!--
8-
`format` is specified as a workaround for https://github.com/nextcloud/calendar/issues/8307
9-
until the issue is fixed in `@nextcloud/vue`.
10-
11-
This works because `@vuepic/vue-datepicker` can use it to parse text inputs from the user
12-
when providing a format as pattern string (and not a one-way function).
13-
-->
147
<DateTimePicker
158
:ariaLabel="ariaLabel"
169
:min="minimumDate"
1710
:max="maximumDate"
1811
:modelValue="date"
1912
:type="type"
2013
class="date-time-picker"
21-
:format="formatStr"
2214
@blur="onBlur"
2315
@update:modelValue="onInput" />
2416
</template>
2517

2618
<script>
27-
import { getCanonicalLocale } from '@nextcloud/l10n'
2819
import {
2920
NcDateTimePicker as DateTimePicker,
3021
} from '@nextcloud/vue'
31-
import { getDateLocalePattern, getDateTimeLocalePattern, getTimeLocalePattern } from 'datetime-locale-patterns'
3222
import { mapStores } from 'pinia'
3323
import useDavRestrictionsStore from '@/store/davRestrictions.js'
3424
35-
const canonicalLocale = getCanonicalLocale()
36-
3725
export default {
3826
name: 'DatePicker',
3927
components: {
@@ -102,28 +90,6 @@ export default {
10290
10391
return this.max || new Date(this.davRestrictionsStore.maximumDate)
10492
},
105-
106-
/**
107-
* Returns the date format pattern for the current picker type.
108-
*
109-
* See https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
110-
*
111-
* @return {string | undefined} A format pattern or `undefined` to use the default `NcDateTimePicker` formatting.
112-
*/
113-
formatStr() {
114-
// Match logic from https://github.com/nextcloud-libraries/nextcloud-vue/blob/v9.8.0/src/components/NcDateTimePicker/NcDateTimePicker.vue#L549
115-
if (this.type === 'date' || this.type === 'date-range') {
116-
return getDateLocalePattern(canonicalLocale, { dateStyle: 'medium' })
117-
} else if (this.type === 'time' || this.type === 'time-range') {
118-
return getTimeLocalePattern(canonicalLocale, { timeStyle: 'short' })
119-
} else if (this.type === 'datetime' || this.type === 'datetime-range') {
120-
return getDateTimeLocalePattern(canonicalLocale, { dateStyle: 'medium', timeStyle: 'short' })
121-
} else {
122-
// 'datetime-locale-patterns' does not support `month` and `year`.
123-
// So fall back to default formatting.
124-
return undefined
125-
}
126-
},
12793
},
12894
12995
methods: {

0 commit comments

Comments
 (0)