New version 2.5.9

This commit is contained in:
Chupurnov Valeriy 2017-10-12 14:38:30 +05:00
parent a60a0db679
commit 9de4639abf
4 changed files with 18 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -78,7 +78,9 @@
<input type="text" id="datetimepicker_format" class="input input-wide"/> <input type="text" id="datetimepicker_format" class="input input-wide"/>
</body> </body>
<script src="./jquery.js"></script> <script src="./jquery.js"></script>
<script src="build/jquery.datetimepicker.full.js"></script> <script src="node_modules/php-date-formatter/js/php-date-formatter.min.js"></script>
<script src="node_modules/jquery-mousewheel/jquery.mousewheel.js"></script>
<script src="jquery.datetimepicker.js"></script>
<script>/* <script>/*
window.onerror = function(errorMsg) { window.onerror = function(errorMsg) {
$('#console').html($('#console').html()+'<br>'+errorMsg) $('#console').html($('#console').html()+'<br>'+errorMsg)

View File

@ -564,6 +564,8 @@ var datetimepickerFactory = function ($) {
maxDate: false, maxDate: false,
minTime: false, minTime: false,
maxTime: false, maxTime: false,
minDateTime: false,
disabledMinTime: false, disabledMinTime: false,
disabledMaxTime: false, disabledMaxTime: false,
@ -1176,6 +1178,10 @@ var datetimepickerFactory = function ($) {
options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate); options.maxDate = dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
} }
if (options.minDateTime && /^\+(.*)$/.test(options.minDateTime)) {
options.minDateTime = _xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate);
}
applyButton.toggle(options.showApplyButton); applyButton.toggle(options.showApplyButton);
month_picker month_picker
@ -1577,6 +1583,7 @@ var datetimepickerFactory = function ($) {
today = _xdsoft_datetime.now(), today = _xdsoft_datetime.now(),
maxDate = false, maxDate = false,
minDate = false, minDate = false,
minDateTime = false,
hDate, hDate,
day, day,
d, d,
@ -1618,6 +1625,11 @@ var datetimepickerFactory = function ($) {
minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
} }
if (options.minDateTime !== false) {
minDateTime = _xdsoft_datetime.strToDate(options.minDateTime);
minDateTime = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds());
}
while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) {
classes = []; classes = [];
i += 1; i += 1;
@ -1645,7 +1657,7 @@ var datetimepickerFactory = function ($) {
if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){ if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate)) === -1){
classes.push('xdsoft_disabled'); classes.push('xdsoft_disabled');
} }
} else if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) { } else if ((maxDate !== false && start > maxDate) || (minDateTime !== false && start < minDateTime) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) {
classes.push('xdsoft_disabled'); classes.push('xdsoft_disabled');
} else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) { } else if (options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate)) !== -1) {
classes.push('xdsoft_disabled'); classes.push('xdsoft_disabled');

View File

@ -1,6 +1,6 @@
{ {
"name": "jquery-datetimepicker", "name": "jquery-datetimepicker",
"version": "2.5.8", "version": "2.5.9",
"description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one", "description": "jQuery Plugin DateTimePicker it is DatePicker and TimePicker in one",
"main": "build/jquery.datetimepicker.full.min.js", "main": "build/jquery.datetimepicker.full.min.js",
"scripts": { "scripts": {