summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogexpirationview.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-15 15:29:30 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-16 07:23:29 +0200
commit996639f4fbd4107851efc11ee34b24cead43e790 (patch)
tree9351ddf424d608b71ecf50715105b7af1131487d /core/js/sharedialogexpirationview.js
parent886f1ed660e91edb8f370cf711ed395fdff7dc30 (diff)
downloadnextcloud-server-996639f4fbd4107851efc11ee34b24cead43e790.tar.gz
nextcloud-server-996639f4fbd4107851efc11ee34b24cead43e790.zip
More unit tests for share dialog
Diffstat (limited to 'core/js/sharedialogexpirationview.js')
-rw-r--r--core/js/sharedialogexpirationview.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/core/js/sharedialogexpirationview.js b/core/js/sharedialogexpirationview.js
index c5d8c829657..3fba4b135d9 100644
--- a/core/js/sharedialogexpirationview.js
+++ b/core/js/sharedialogexpirationview.js
@@ -130,7 +130,7 @@
);
}
- var isExpirationSet = !!this.model.get('linkShare').expiration;
+ var isExpirationSet = !!this.model.get('linkShare').expiration || isExpirationEnforced;
var expirationTemplate = this.template();
this.$el.html(expirationTemplate({
@@ -145,13 +145,13 @@
expirationValue: this.model.get('linkShare').expiration
}));
- if(isExpirationSet) {
- // what if there is another date picker on that page?
- var minDate = new Date();
- // min date should always be the next day
- minDate.setDate(minDate.getDate()+1);
+ // what if there is another date picker on that page?
+ var minDate = new Date();
+ var maxDate = null;
+ // min date should always be the next day
+ minDate.setDate(minDate.getDate()+1);
- var maxDate = null;
+ if(isExpirationSet) {
if(isExpirationEnforced) {
// TODO: hack: backend returns string instead of integer
var shareTime = this.model.get('linkShare').stime;
@@ -164,12 +164,11 @@
shareTime = OC.Util.stripTime(shareTime).getTime();
maxDate = new Date(shareTime + defaultExpireDays * 24 * 3600 * 1000);
}
-
- $.datepicker.setDefaults({
- minDate: minDate,
- maxDate: maxDate
- });
}
+ $.datepicker.setDefaults({
+ minDate: minDate,
+ maxDate: maxDate
+ });
this.$el.find('.datepicker').datepicker({dateFormat : 'dd-mm-yy'});