Skip to content

Commit

Permalink
Improve the regex for 24h hour format. #37
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Jul 9, 2015
1 parent 68dc3fa commit 2fff353
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright 2015 ToolwatchApp
*/

var hoursRegExp = new RegExp("([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]");
var hoursRegExp = new RegExp("^([01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$");

$(document).ready(function()
{
Expand Down Expand Up @@ -283,8 +283,6 @@ $(document).ready(function()
var userTimezone= (myDate.getTimezoneOffset()/60)+1;
var measureId = $('input[name="measureId"]').val();

console.log(hoursRegExp.test(userTime));

if(hoursRegExp.test(userTime))
{
$('.btn-spinner i').css('display', 'inline-block');
Expand Down

0 comments on commit 2fff353

Please sign in to comment.