mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
Merge pull request #52407 from nextcloud/backport/52364/stable29
[stable29] fix(files_sharing): Improve expiration date input change handling
This commit is contained in:
commit
1cb6d58d12
9 changed files with 19 additions and 13 deletions
|
|
@ -118,7 +118,8 @@
|
|||
type="date"
|
||||
:min="dateTomorrow"
|
||||
:max="maxExpirationDateEnforced"
|
||||
@change="expirationDateChanged($event)">
|
||||
@update:model-value="onExpirationChange"
|
||||
@change="expirationDateChanged">
|
||||
<template #icon>
|
||||
<IconCalendarBlank :size="20" />
|
||||
</template>
|
||||
|
|
@ -861,9 +862,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
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -255,8 +255,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)
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
3
dist/2032-2032.js
vendored
3
dist/2032-2032.js
vendored
File diff suppressed because one or more lines are too long
1
dist/2032-2032.js.map
vendored
1
dist/2032-2032.js.map
vendored
File diff suppressed because one or more lines are too long
3
dist/4774-4774.js
vendored
Normal file
3
dist/4774-4774.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/4774-4774.js.map
vendored
Normal file
1
dist/4774-4774.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue