diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-09-04 16:14:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-04 16:14:42 +0200 |
commit | c484ce45299879f9000947625d2488d4f23c4cd9 (patch) | |
tree | a12772d35f2056d5e60ec1a830e8df3d5d2bd249 | |
parent | 7d3b2ae61bcf4566cf63ebf0277a6002c6fdf74f (diff) | |
parent | 9e68367d03bc4ff789b77c897a35c9b031406613 (diff) |
Fix moment loading (#1249)
Fix moment loading
-rw-r--r-- | package-lock.json | 6 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | src/components/Properties/PropertyDateTime.vue | 24 |
3 files changed, 18 insertions, 14 deletions
diff --git a/package-lock.json b/package-lock.json index 25dc0fef..89e12a63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7332,9 +7332,9 @@ } }, "nextcloud-vue": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/nextcloud-vue/-/nextcloud-vue-0.12.2.tgz", - "integrity": "sha512-FMyDZ4PcXF2T0SQNXV13bncH/1v0bSe0t6dTwIOSaxiONknWjJEbuJSqwh1ZlcqzWSxFlIKvJn1/Jk2e/UO6aA==", + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/nextcloud-vue/-/nextcloud-vue-0.12.3.tgz", + "integrity": "sha512-qH0s1A9jgsbd9LU+icOIkQIcu9HoY8IW+ELUmP+HJvOdLAjAh3TtEz9ifsy+RcnUUOqASTveSEqxVmXDckwWeQ==", "requires": { "@babel/polyfill": "^7.4.4", "escape-html": "^1.0.3", diff --git a/package.json b/package.json index 56842a8f..9698b9a7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "nextcloud-dialogs": "0.0.3", "nextcloud-l10n": "0.1.0", "nextcloud-router": "0.0.9", - "nextcloud-vue": "^0.12.2", + "nextcloud-vue": "^0.12.3", "p-limit": "^2.2.1", "p-queue": "^6.1.1", "qr-image": "^3.2.0", diff --git a/src/components/Properties/PropertyDateTime.vue b/src/components/Properties/PropertyDateTime.vue index 83b1a314..f93d1092 100644 --- a/src/components/Properties/PropertyDateTime.vue +++ b/src/components/Properties/PropertyDateTime.vue @@ -136,22 +136,26 @@ export default { let locale = getLocale().replace('_', '-').toLowerCase() // default load e.g. fr-fr - import('moment/locale/' + this.locale) + console.debug('Importing locale', locale) + import('moment/locale/' + locale) .then(e => { // force locale change to update // the component once done loading this.locale = locale }) .catch(e => { - // failure: fallback to fr - import('moment/locale/' + locale.split('-')[0]) - .then(e => { - this.locale = locale.split('-')[0] - }) - .catch(e => { - // failure, fallback to english - this.locale = 'en' - }) + // failure: fallback to fr + locale = locale.split('-')[0] + console.debug('Fallback to locale', locale) + import('moment/locale/' + locale) + .then(e => { + this.locale = locale + }) + .catch(e => { + console.debug('Fallback to locale', 'en') + // failure, fallback to english + this.locale = 'en' + }) }) }, |