set minDate and maxDate in datepicker
This commit is contained in:
parent
f15d7dfec0
commit
9c00f5ddb6
|
@ -84,6 +84,8 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
|
||||||
$date = new \DateTime($_POST['date']);
|
$date = new \DateTime($_POST['date']);
|
||||||
$today = new \DateTime('now');
|
$today = new \DateTime('now');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($date < $today) {
|
if ($date < $today) {
|
||||||
OC_JSON::error(array('data' => array('message' => $l->t('Expiration date is in the past.'))));
|
OC_JSON::error(array('data' => array('message' => $l->t('Expiration date is in the past.'))));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -673,6 +673,9 @@ OC.Share={
|
||||||
});
|
});
|
||||||
if (oc_appconfig.core.defaultExpireDateEnforced) {
|
if (oc_appconfig.core.defaultExpireDateEnforced) {
|
||||||
$('#expirationCheckbox').attr('disabled', true);
|
$('#expirationCheckbox').attr('disabled', true);
|
||||||
|
$.datepicker.setDefaults({
|
||||||
|
maxDate : new Date(date.replace(' 00:00:00', ''))
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if(oc_appconfig.core.defaultExpireDateEnabled) {
|
if(oc_appconfig.core.defaultExpireDateEnabled) {
|
||||||
$('#defaultExpireMessage').show('blind');
|
$('#defaultExpireMessage').show('blind');
|
||||||
|
@ -689,7 +692,8 @@ $(document).ready(function() {
|
||||||
dayNames: dayNames,
|
dayNames: dayNames,
|
||||||
dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }),
|
dayNamesMin: $.map(dayNames, function(v) { return v.slice(0,2); }),
|
||||||
dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }),
|
dayNamesShort: $.map(dayNames, function(v) { return v.slice(0,3)+'.'; }),
|
||||||
firstDay: firstDay
|
firstDay: firstDay,
|
||||||
|
minDate : new Date()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$(document).on('click', 'a.share', function(event) {
|
$(document).on('click', 'a.share', function(event) {
|
||||||
|
|
Loading…
Reference in New Issue