diff options
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntry.vue')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 09d09d607fe..cde7d2ed2b1 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -213,6 +213,28 @@ export default { set: function(checked) { this.updatePermissions(this.canEdit, checked) } + }, + + /** + * Does the current share have an expiration date + * @returns {boolean} + */ + hasExpirationDate: { + get: function() { + return this.config.isDefaultInternalExpireDateEnforced || !!this.share.expireDate + }, + set: function(enabled) { + this.share.expireDate = enabled + ? this.config.defaultInternalExpirationDateString !== '' + ? this.config.defaultInternalExpirationDateString + : moment().format('YYYY-MM-DD') + : '' + } + }, + + dateMaxEnforced() { + return this.config.isDefaultInternalExpireDateEnforced + && moment().add(1 + this.config.defaultInternalExpireDate, 'days') } }, |