]> source.dussan.org Git - nextcloud-server.git/commitdiff
set minDate always to today + one day
authorBjoern Schiessle <schiessle@owncloud.com>
Fri, 8 Aug 2014 09:09:17 +0000 (11:09 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 11 Aug 2014 08:07:30 +0000 (10:07 +0200)
core/js/share.js

index 1b4e519f2012f06eb2462f04cf9113cabca2750f..eceb6b98f1ea59b55a368d53200307433610627e 100644 (file)
@@ -724,8 +724,11 @@ OC.Share={
         */
        showExpirationDate:function(date, shareTime) {
                var now = new Date();
+               // min date should always be the next day
+               var minDate = new Date();
+               minDate.setDate(minDate.getDate()+1);
                var datePickerOptions = {
-                       minDate: now,
+                       minDate: minDate,
                        maxDate: null
                };
                if (_.isNumber(shareTime)) {
@@ -757,6 +760,9 @@ OC.Share={
 $(document).ready(function() {
 
        if(typeof monthNames != 'undefined'){
+               // min date should always be the next day
+               var minDate = new Date();
+               minDate.setDate(minDate.getDate()+1);
                $.datepicker.setDefaults({
                        monthNames: monthNames,
                        monthNamesShort: $.map(monthNames, function(v) { return v.slice(0,3)+'.'; }),
@@ -764,7 +770,7 @@ $(document).ready(function() {
                        dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }),
                        dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }),
                        firstDay: firstDay,
-                       minDate : new Date()
+                       minDate : minDate
                });
        }
        $(document).on('click', 'a.share', function(event) {