From 6cc19d56d23497b3fc18adfd0cfda9be7057ce36 Mon Sep 17 00:00:00 2001 From: Bilal Korkmaz Date: Mon, 29 Feb 2016 13:43:02 +0200 Subject: [PATCH] #404 not selectable for readonly input element --- jquery.datetimepicker.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index c9429e2..8960985 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -1708,7 +1708,9 @@ classes.push('xdsoft_disabled'); } else if (options.disabledWeekDays.indexOf(day) !== -1) { classes.push('xdsoft_disabled'); - } + }else if (input.is('[readonly]')) { + classes.push('xdsoft_disabled'); + } if (customDateSettings && customDateSettings[1] !== "") { classes.push(customDateSettings[1]); @@ -1781,13 +1783,14 @@ optionDateTime = new Date(_xdsoft_datetime.currentTime); optionDateTime.setHours(h); optionDateTime.setMinutes(m); - classes = []; + classes = []; if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) { - classes.push('xdsoft_disabled'); - } - if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) { - classes.push('xdsoft_disabled'); - } + classes.push('xdsoft_disabled'); + } else if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || ((options.disabledMinTime !== false && now.getTime() > _xdsoft_datetime.strtotime(options.disabledMinTime).getTime()) && (options.disabledMaxTime !== false && now.getTime() < _xdsoft_datetime.strtotime(options.disabledMaxTime).getTime()))) { + classes.push('xdsoft_disabled'); + } else if (input.is('[readonly]')) { + classes.push('xdsoft_disabled'); + } current_time = new Date(_xdsoft_datetime.currentTime); current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));