Permalink
Browse files

If either hours or minutes is required and missing, time will not be …

…parsed - issue #50
  • Loading branch information...
1 parent 1652b5c commit 4607638818468c3ce5494242c33c4f393232095a @fgelinas committed Oct 23, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 jquery.ui.timepicker.js
@@ -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),
@@ -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;

0 comments on commit 4607638

Please sign in to comment.