aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-07-18 15:23:28 +0200
committerskjnldsv <skjnldsv@protonmail.com>2024-07-18 20:15:39 +0200
commit607f0b0e9a513cb317ae7c4d529285cc0cb48831 (patch)
tree62d838972c5cee8c1e3db02c21d3b512820d4746
parent08d3fed24f778d1cf3257ce782eede5b5e8d1154 (diff)
downloadnextcloud-server-607f0b0e9a513cb317ae7c4d529285cc0cb48831.tar.gz
nextcloud-server-607f0b0e9a513cb317ae7c4d529285cc0cb48831.zip
fix(files_sharing): file request expiration date timezone
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
-rw-r--r--apps/files_sharing/src/components/NewFileRequestDialog.vue13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files_sharing/src/components/NewFileRequestDialog.vue b/apps/files_sharing/src/components/NewFileRequestDialog.vue
index 4ff31adb9ab..6b0bb5a1fc2 100644
--- a/apps/files_sharing/src/components/NewFileRequestDialog.vue
+++ b/apps/files_sharing/src/components/NewFileRequestDialog.vue
@@ -270,8 +270,19 @@ export default defineComponent({
async createShare() {
this.loading = true
+ // This should never happen™
+ if (this.expirationDate == null) {
+ throw new Error('Expiration date is missing')
+ }
+
+ const year = this.expirationDate.getFullYear()
+ const month = (this.expirationDate.getMonth() + 1).toString().padStart(2, '0')
+ const day = this.expirationDate.getDate().toString().padStart(2, '0')
+
// Format must be YYYY-MM-DD
- const expireDate = this.expirationDate ? this.expirationDate.toISOString().split('T')[0] : undefined
+ const expireDate = this.expirationDate
+ ? `${year}-${month}-${day}`
+ : undefined
const shareUrl = generateOcsUrl('apps/files_sharing/api/v1/shares')
try {
const request = await axios.post<OCSResponse>(shareUrl, {