Browse files

Fixed the start-end time example for when a boundary value is empty.

  • Loading branch information...
1 parent 627aefd commit 0ce89fec99b6e914609ba8688406946a8745c6c3 @fgelinas committed Jul 3, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 index.html
View
8 index.html
@@ -621,6 +621,8 @@
function tpStartOnHourShowCallback(hour) {
var tpEndHour = $('#timepicker_end').timepicker('getHour');
+ // all valid if no end time selected
+ if ($('#timepicker_end').val() == '') { return true; }
// Check if proposed hour is prior or equal to selected end time hour
if (hour <= tpEndHour) { return true; }
// if hour did not match, it can not be selected
@@ -629,6 +631,8 @@
function tpStartOnMinuteShowCallback(hour, minute) {
var tpEndHour = $('#timepicker_end').timepicker('getHour');
var tpEndMinute = $('#timepicker_end').timepicker('getMinute');
+ // all valid if no end time selected
+ if ($('#timepicker_end').val() == '') { return true; }
// Check if proposed hour is prior to selected end time hour
if (hour < tpEndHour) { return true; }
// Check if proposed hour is equal to selected end time hour and minutes is prior
@@ -639,6 +643,8 @@
function tpEndOnHourShowCallback(hour) {
var tpStartHour = $('#timepicker_start').timepicker('getHour');
+ // all valid if no start time selected
+ if ($('#timepicker_start').val() == '') { return true; }
// Check if proposed hour is after or equal to selected start time hour
if (hour >= tpStartHour) { return true; }
// if hour did not match, it can not be selected
@@ -647,6 +653,8 @@
function tpEndOnMinuteShowCallback(hour, minute) {
var tpStartHour = $('#timepicker_start').timepicker('getHour');
var tpStartMinute = $('#timepicker_start').timepicker('getMinute');
+ // all valid if no start time selected
+ if ($('#timepicker_start').val() == '') { return true; }
// Check if proposed hour is after selected start time hour
if (hour > tpStartHour) { return true; }
// Check if proposed hour is equal to selected start time hour and minutes is after

0 comments on commit 0ce89fe

Please sign in to comment.