From: fenn-cs Date: Fri, 8 Dec 2023 17:02:14 +0000 (+0100) Subject: Allow user to finish typing date before formatting X-Git-Tag: v29.0.0beta1~661^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=04e87337211351127cd02a0404936de8cb1b0837;p=nextcloud-server.git Allow user to finish typing date before formatting Debounce `onExpirationChange` to avoid calling `formatDateToString` on invalid on uncompletely inputed date strings. Signed-off-by: fenn-cs --- diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index 41bdf302f7a..b76b72cebe9 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -221,10 +221,9 @@ export default { * * @param {Date} date */ - onExpirationChange(date) { + onExpirationChange: debounce((date) => { this.share.expireDate = this.formatDateToString(new Date(date)) - }, - + }, 500), /** * Uncheck expire date * We need this method because @update:checked