Skip to content

Commit

Permalink
Fixed the start-end time example for when a boundary value is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgelinas committed Jul 4, 2012
1 parent e61baa8 commit 627aefd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.html
Expand Up @@ -561,6 +561,8 @@ <h2>What is this?</h2>

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
Expand All @@ -569,6 +571,8 @@ <h2>What is this?</h2>
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
Expand All @@ -579,6 +583,8 @@ <h2>What is this?</h2>

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
Expand All @@ -587,6 +593,8 @@ <h2>What is this?</h2>
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
Expand Down

0 comments on commit 627aefd

Please sign in to comment.