aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/components/SharingEntry.vue
diff options
context:
space:
mode:
authorjulia.kirschenheuter <julia.kirschenheuter@nextcloud.com>2022-09-06 12:43:50 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2022-10-06 08:56:06 +0000
commit1eac730cafa99bf47924e0d70c43e0e2cf6d0455 (patch)
tree2596a7241e984a0ef4586bffac15bcb11e0e36bf /apps/files_sharing/src/components/SharingEntry.vue
parentb57115df3ff0c7ffc23ed5844225df2d21e4ee5b (diff)
downloadnextcloud-server-1eac730cafa99bf47924e0d70c43e0e2cf6d0455.tar.gz
nextcloud-server-1eac730cafa99bf47924e0d70c43e0e2cf6d0455.zip
Replace moment.js date with Date Object.
Replace vue2-datepicker with native date picker for expiration date. Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntry.vue')
-rw-r--r--apps/files_sharing/src/components/SharingEntry.vue32
1 files changed, 13 insertions, 19 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue
index fccabf4532b..9627f2d77c5 100644
--- a/apps/files_sharing/src/components/SharingEntry.vue
+++ b/apps/files_sharing/src/components/SharingEntry.vue
@@ -95,20 +95,15 @@
</NcActionCheckbox>
<NcActionInput v-if="hasExpirationDate"
ref="expireDate"
- v-tooltip.auto="{
- content: errors.expireDate,
- show: errors.expireDate,
- trigger: 'manual'
- }"
+ :is-native-picker="true"
+ :hide-label="true"
:class="{ error: errors.expireDate}"
:disabled="saving"
- :lang="lang"
:value="share.expireDate"
- value-type="format"
- icon="icon-calendar-dark"
type="date"
- :disabled-date="disabledDate"
- @update:value="onExpirationChange">
+ :min="dateTomorrow"
+ :max="dateMaxEnforced"
+ @input="onExpirationChange">
{{ t('files_sharing', 'Enter a date') }}
</NcActionInput>
@@ -380,21 +375,20 @@ export default {
},
set(enabled) {
this.share.expireDate = enabled
- ? this.config.defaultInternalExpirationDateString !== ''
- ? this.config.defaultInternalExpirationDateString
- : moment().format('YYYY-MM-DD')
+ ? this.config.defaultInternalExpirationDate !== ''
+ ? this.config.defaultInternalExpirationDate
+ : new Date()
: ''
},
},
dateMaxEnforced() {
- if (!this.isRemote) {
- return this.config.isDefaultInternalExpireDateEnforced
- && moment().add(1 + this.config.defaultInternalExpireDate, 'days')
- } else {
- return this.config.isDefaultRemoteExpireDateEnforced
- && moment().add(1 + this.config.defaultRemoteExpireDate, 'days')
+ if (!this.isRemote && this.config.isDefaultInternalExpireDateEnforced) {
+ return new Date(new Date().setDate(new Date().getDate() + 1 + this.config.defaultInternalExpireDate))
+ } else if (this.config.isDefaultRemoteExpireDateEnforced) {
+ return new Date(new Date().setDate(new Date().getDate() + 1 + this.config.defaultRemoteExpireDate))
}
+ return null
},
/**