Merge pull request #1945 from nextcloud/bugfix/noid/datetime

This commit is contained in:
Julius Härtl
2020-05-29 15:38:21 +02:00
committed by GitHub
4 changed files with 71 additions and 28 deletions

73
package-lock.json generated
View File

@@ -3005,26 +3005,27 @@
} }
}, },
"@nextcloud/vue": { "@nextcloud/vue": {
"version": "1.5.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-1.5.0.tgz", "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-2.0.0.tgz",
"integrity": "sha512-z0KZP0PcWyHsD5zpzBJRusToGzC/1DTjapuDMrSAOSuA5lThg/Td7brmIQSwWTrw66OrL5MIRK+8HoKMWmQPAA==", "integrity": "sha512-Y8OmsRHvskpRbfcBXUy8U6+Ctl8kyWK8qHkmsi1kWL85l0262OxcTA9BU/Qh9vAn9sqTrT7skXRAVnQckO4y0A==",
"requires": { "requires": {
"@nextcloud/axios": "^1.1.0", "@nextcloud/auth": "^1.2.3",
"@nextcloud/l10n": "^1.1.0", "@nextcloud/axios": "^1.3.2",
"@nextcloud/router": "^1.0.0", "@nextcloud/event-bus": "^1.1.4",
"core-js": "^3.4.4", "@nextcloud/l10n": "^1.2.3",
"@nextcloud/router": "^1.0.2",
"core-js": "^3.6.5",
"debounce": "1.2.0", "debounce": "1.2.0",
"escape-html": "^1.0.3",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"md5": "^2.2.1", "md5": "^2.2.1",
"regenerator-runtime": "^0.13.3", "regenerator-runtime": "^0.13.5",
"v-click-outside": "^3.0.0", "v-click-outside": "^3.0.1",
"v-tooltip": "^2.0.0-rc.33", "v-tooltip": "^2.0.3",
"vue": "^2.6.7", "vue": "^2.6.11",
"vue-color": "^2.7.0", "vue-color": "^2.7.1",
"vue-multiselect": "^2.1.3", "vue-multiselect": "^2.1.6",
"vue-visible": "^1.0.2", "vue-visible": "^1.0.2",
"vue2-datepicker": "^3.3.1" "vue2-datepicker": "^3.4.1"
}, },
"dependencies": { "dependencies": {
"core-js": { "core-js": {
@@ -6224,9 +6225,9 @@
} }
}, },
"date-fns": { "date-fns": {
"version": "2.12.0", "version": "2.14.0",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.12.0.tgz", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.14.0.tgz",
"integrity": "sha512-qJgn99xxKnFgB1qL4jpxU7Q2t0LOn1p8KMIveef3UZD7kqjT3tpFNNdXJelEHhE+rUgffriXriw/sOSU+cS1Hw==" "integrity": "sha512-1zD+68jhFgDIM0rF05rcwYO8cExdNqxjq4xP1QKM60Q45mnO6zaMWB4tOzrIr4M4GSLntsKeE4c9Bdl2jhL/yw=="
}, },
"date-format-parse": { "date-format-parse": {
"version": "0.2.5", "version": "0.2.5",
@@ -13226,6 +13227,36 @@
"@nextcloud/vue": "^1.3.0", "@nextcloud/vue": "^1.3.0",
"lodash": "^4.17.11", "lodash": "^4.17.11",
"vue": "^2.6.11" "vue": "^2.6.11"
},
"dependencies": {
"@nextcloud/vue": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-1.5.0.tgz",
"integrity": "sha512-z0KZP0PcWyHsD5zpzBJRusToGzC/1DTjapuDMrSAOSuA5lThg/Td7brmIQSwWTrw66OrL5MIRK+8HoKMWmQPAA==",
"requires": {
"@nextcloud/axios": "^1.1.0",
"@nextcloud/l10n": "^1.1.0",
"@nextcloud/router": "^1.0.0",
"core-js": "^3.4.4",
"debounce": "1.2.0",
"escape-html": "^1.0.3",
"hammerjs": "^2.0.8",
"md5": "^2.2.1",
"regenerator-runtime": "^0.13.3",
"v-click-outside": "^3.0.0",
"v-tooltip": "^2.0.0-rc.33",
"vue": "^2.6.7",
"vue-color": "^2.7.0",
"vue-multiselect": "^2.1.3",
"vue-visible": "^1.0.2",
"vue2-datepicker": "^3.3.1"
}
},
"core-js": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz",
"integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA=="
}
} }
}, },
"nice-try": { "nice-try": {
@@ -18806,9 +18837,9 @@
"integrity": "sha512-yaX2its9XAJKGuQqf7LsiZHHSkxsIK8rmCOQOvEGEoF41blKRK8qr9my4qYoD6ikdLss4n8tKqYBecmaY0+WJg==" "integrity": "sha512-yaX2its9XAJKGuQqf7LsiZHHSkxsIK8rmCOQOvEGEoF41blKRK8qr9my4qYoD6ikdLss4n8tKqYBecmaY0+WJg=="
}, },
"vue2-datepicker": { "vue2-datepicker": {
"version": "3.4.1", "version": "3.5.0",
"resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-3.4.1.tgz", "resolved": "https://registry.npmjs.org/vue2-datepicker/-/vue2-datepicker-3.5.0.tgz",
"integrity": "sha512-gCPZAwIyPLeN1P3xDg/Oj/UyQTIqnoFFzXw+yfvmUDxL430u/rHq1/JqFSGISEhTvJJu0brgHHrop3A7VBW6rA==", "integrity": "sha512-E52TUjf57Qj2ZWtwtplS+BtYfz8wQFHnjux0q2X8N+ENvL3rHjp9pwEs0ukT1rDTouLdPtvACaXXLfDEy39mlw==",
"requires": { "requires": {
"date-fns": "^2.0.1", "date-fns": "^2.0.1",
"date-format-parse": "^0.2.5" "date-format-parse": "^0.2.5"

View File

@@ -39,7 +39,7 @@
"@nextcloud/l10n": "^1.2.3", "@nextcloud/l10n": "^1.2.3",
"@nextcloud/moment": "^1.1.1", "@nextcloud/moment": "^1.1.1",
"@nextcloud/router": "^1.0.2", "@nextcloud/router": "^1.0.2",
"@nextcloud/vue": "^1.5.0", "@nextcloud/vue": "^2.0.0",
"blueimp-md5": "^2.16.0", "blueimp-md5": "^2.16.0",
"dompurify": "^2.0.11", "dompurify": "^2.0.11",
"lodash": "^4.17.15", "lodash": "^4.17.15",

View File

@@ -104,6 +104,9 @@
<DatetimePicker v-model="duedate" <DatetimePicker v-model="duedate"
:placeholder="t('deck', 'Set a due date')" :placeholder="t('deck', 'Set a due date')"
type="datetime" type="datetime"
:minute-step="5"
:show-second="false"
:format="format"
:disabled="saving || !canEdit" :disabled="saving || !canEdit"
confirm /> confirm />
<Actions v-if="canEdit"> <Actions v-if="canEdit">
@@ -203,6 +206,8 @@ import { formatFileSize } from '@nextcloud/files'
import relativeDate from '../../mixins/relativeDate' import relativeDate from '../../mixins/relativeDate'
import AttachmentList from './AttachmentList' import AttachmentList from './AttachmentList'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
import { getLocale } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
const markdownIt = new MarkdownIt({ const markdownIt = new MarkdownIt({
linkify: true, linkify: true,
@@ -242,6 +247,7 @@ export default {
addedLabelToCard: null, addedLabelToCard: null,
copiedCard: null, copiedCard: null,
allLabels: null, allLabels: null,
locale: getLocale(),
saving: false, saving: false,
markdownIt: null, markdownIt: null,
@@ -260,6 +266,10 @@ export default {
hasActivity: capabilities && capabilities.activity, hasActivity: capabilities && capabilities.activity,
hasComments: !!OC.appswebroots['comments'], hasComments: !!OC.appswebroots['comments'],
modalShow: false, modalShow: false,
format: {
stringify: this.stringify,
parse: this.parse,
},
} }
}, },
computed: { computed: {
@@ -485,6 +495,12 @@ export default {
} }
this.$store.dispatch('removeLabel', data) this.$store.dispatch('removeLabel', data)
}, },
stringify(date) {
return moment(date).locale(this.locale).format('LLL')
},
parse(value) {
return moment(value, 'LLL', this.locale).toDate()
},
}, },
} }
</script> </script>

View File

@@ -42,12 +42,8 @@ if (!process.env.HOT) {
} }
sync(store, router) sync(store, router)
Vue.mixin({ Vue.prototype.t = translate
methods: { Vue.prototype.n = translatePlural
t: translate,
n: translatePlural,
},
})
Vue.directive('tooltip', Tooltip) Vue.directive('tooltip', Tooltip)
Vue.directive('click-outside', ClickOutside) Vue.directive('click-outside', ClickOutside)