diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-11-16 12:19:35 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-11-16 17:19:58 +0100 |
commit | 2b4ce7b95d6c009695d7f2ea02da424b538807a4 (patch) | |
tree | 426454b77042c964d04e3f0a52e4229c08730b09 /apps/files_sharing/src/components/SharingEntry.vue | |
parent | 3d77e386cd18a2e390d66118927cc75be0ef909c (diff) | |
download | nextcloud-server-2b4ce7b95d6c009695d7f2ea02da424b538807a4.tar.gz nextcloud-server-2b4ce7b95d6c009695d7f2ea02da424b538807a4.zip |
Fix date handling and saving
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntry.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 12 |
1 files changed, 5 insertions, 7 deletions
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) }, |