trentrichardson/jQuery-Timepicker-Addon — Issue #331: comparison and validation when manually typed.
Author: titombo
Created: 2012-03-06 12:35:05+00:00
State: open

I am building a jQuery plugin to create subtitles on videos and I using the library Timepicker UI to define the begin and end of each part of the subtitle.

I am using an input tag:

And the javascript code using the format (hh:mm:ss):

$('.HoursStart ').timepicker(
{
showSecond: true,
timeFormat: 'hh:mm:ss'
});

The problems are with the validation:

1. Is there a way to just allow the input to accept the format hh:mm:ss (just numbers on the correct range) ?

2. Is there a way to make the comparisons between two inputs (something like if (12:21:12 > 11:31:12))?

I really appreciate your help to solve this validation problems.