summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/components/SharingEntryLink.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntryLink.vue')
-rw-r--r--apps/files_sharing/src/components/SharingEntryLink.vue22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue
index 407d674e77a..ddfe953e339 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -380,6 +380,28 @@ export default {
},
/**
+ * Does the current share have an expiration date
+ * @returns {boolean}
+ */
+ hasExpirationDate: {
+ get: function() {
+ return this.config.isDefaultExpireDateEnforced || !!this.share.expireDate
+ },
+ set: function(enabled) {
+ this.share.expireDate = enabled
+ ? this.config.defaultExpirationDateString !== ''
+ ? this.config.defaultExpirationDateString
+ : moment().format('YYYY-MM-DD')
+ : ''
+ }
+ },
+
+ dateMaxEnforced() {
+ return this.config.isDefaultExpireDateEnforced
+ && moment().add(1 + this.config.defaultExpireDate, 'days')
+ },
+
+ /**
* Is the current share password protected ?
* @returns {boolean}
*/