Merge pull request #52409 from nextcloud/backport/52364/stable31

[stable31] fix(files_sharing): Improve expiration date input change handling
This commit is contained in:
F. E Noel Nfebe 2025-04-24 21:39:17 +02:00 committed by GitHub
commit 989f24fea6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 19 additions and 13 deletions

View file

@ -102,7 +102,8 @@
type="date"
:min="dateTomorrow"
:max="maxExpirationDateEnforced"
@change="expirationDateChanged($event)">
@update:model-value="onExpirationChange"
@change="expirationDateChanged">
<template #icon>
<IconCalendarBlank :size="20" />
</template>
@ -866,9 +867,9 @@ export default {
},
expirationDateChanged(event) {
const date = event.target.value
this.onExpirationChange(date)
this.defaultExpirationDateEnabled = !!date
const value = event?.target?.value
const isValid = !!value && !isNaN(new Date(value).getTime())
this.defaultExpirationDateEnabled = isValid
},
/**

View file

@ -234,8 +234,13 @@ export default {
* @param {Date} date
*/
onExpirationChange(date) {
const formattedDate = date ? this.formatDateToString(new Date(date)) : ''
this.share.expireDate = formattedDate
if (!date) {
this.share.expireDate = null
this.$set(this.share, 'expireDate', null)
return
}
const parsedDate = (date instanceof Date) ? date : new Date(date)
this.share.expireDate = this.formatDateToString(parsedDate)
},
/**

2
dist/5329-5329.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/5329-5329.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/5329-5329.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
5329-5329.js.license

2
dist/7694-7694.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
7694-7694.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long