diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-11 12:06:53 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-01-15 11:27:14 +0100 |
commit | 6c4892210a03db71e99c7c9e48622ab2f245bda4 (patch) | |
tree | fdec3bcda4a11387ffeb52996fda5c1372fd9596 /src/components/Properties | |
parent | 131667f5fdf3d830084603da37590956a7c15424 (diff) |
Update Datepicker script for nextcloud-vue 0.5.1
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components/Properties')
-rw-r--r-- | src/components/Properties/PropertyDateTime.vue | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/components/Properties/PropertyDateTime.vue b/src/components/Properties/PropertyDateTime.vue index e8304281..96c72f58 100644 --- a/src/components/Properties/PropertyDateTime.vue +++ b/src/components/Properties/PropertyDateTime.vue @@ -130,10 +130,18 @@ let formatDateTime = function(vcardTime, type, locale) { * location of the call. So this = DatetimePicker. * Therefore we can use any props we pass through datetime-picker * + * ! TODO: use a DEDICATED function in vue2-datepicker instead of this weird hack + * * @returns {string} */ -DatetimePicker.methods.stringify = function() { - return formatDateTime(this.$parent.localValue, this.type, this.$parent.locale) +if (DatetimePicker && DatetimePicker.methods) { + DatetimePicker.methods.stringify = function() { + return formatDateTime(this.$parent.localValue, this.type, this.$parent.locale) + } +} else { + DatetimePicker.components.DatePicker.methods.stringify = function() { + return formatDateTime(this.$parent.$parent.localValue, this.type, this.$parent.$parent.locale) + } } export default { @@ -164,7 +172,7 @@ export default { : 'time', // locale and lang data - locale: 'en', // temporary value, see mounted + locale: 'en', firstDay: window.firstDay + 1, // provided by nextcloud lang: { days: window.dayNamesShort, // provided by nextcloud |