Skip to content

Commit

Permalink
If either hours or minutes is required and missing, time will not be …
Browse files Browse the repository at this point in the history
…parsed - issue #50
  • Loading branch information
fgelinas committed Oct 23, 2012
1 parent 1652b5c commit 4607638
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions jquery.ui.timepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1266,15 +1266,6 @@
/* this function process selected time and return it parsed according to instance options */
_getParsedTime: function(inst) {

if (inst.hours == -1 && inst.minutes == -1) {
return '';
}

// default to 0 AM if hours is not valid
if ((inst.hours < inst.hours.starts) || (inst.hours > inst.hours.ends )) { inst.hours = 0; }
// default to 0 minutes if minute is not valid
if ((inst.minutes < inst.minutes.starts) || (inst.minutes > inst.minutes.ends)) { inst.minutes = 0; }

var period = "",
showPeriod = (this._get(inst, 'showPeriod') == true),
showLeadingZero = (this._get(inst, 'showLeadingZero') == true),
Expand All @@ -1287,6 +1278,10 @@
displayHours = selectedHours ? selectedHours : 0,
parsedTime = '';

// changed version 0.3.2 - If either hours or minutes is required and missing, time will not be parsed
if (showHours && inst.hours == -1) { return '' }
if (showMinutes && inst.minutes == -1) { return '' }

if (showPeriod) {
if (inst.hours == 0) {
displayHours = 12;
Expand Down

0 comments on commit 4607638

Please sign in to comment.