From: John Molakvoæ Date: Wed, 16 Nov 2022 11:19:35 +0000 (+0100) Subject: Fix date handling and saving X-Git-Tag: v26.0.0beta1~400^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b4ce7b95d6c009695d7f2ea02da424b538807a4;p=nextcloud-server.git Fix date handling and saving Signed-off-by: John Molakvoæ --- diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 7cc283e705c..932f65c20b2 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -99,7 +99,7 @@ :hide-label="true" :class="{ error: errors.expireDate}" :disabled="saving" - :value="share.expireDate" + :value="new Date(share.expireDate)" type="date" :min="dateTomorrow" :max="dateMaxEnforced" @@ -149,7 +149,7 @@ import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput' import NcActionTextEditable from '@nextcloud/vue/dist/Components/NcActionTextEditable' import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip' -import SharesMixin from '../mixins/SharesMixin' +import SharesMixin from '../mixins/SharesMixin.js' export default { name: 'SharingEntry', @@ -374,12 +374,10 @@ export default { return this.config.isDefaultInternalExpireDateEnforced || !!this.share.expireDate }, set(enabled) { - let defaultExpirationDate = this.config.defaultInternalExpirationDate - if (!defaultExpirationDate) { - defaultExpirationDate = new Date() - } + const defaultExpirationDate = this.config.defaultInternalExpirationDate + || new Date(new Date().setDate(new Date().getDate() + 1)) this.share.expireDate = enabled - ? defaultExpirationDate + ? this.formatDateToString(defaultExpirationDate) : '' console.debug('Expiration date status', enabled, this.share.expireDate) }, diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index e1118e680c0..207db7d8514 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -97,14 +97,15 @@ {{ t('files_sharing', 'Expiration date (enforced)') }}