From 2fff353479305d11f8018aa0d14e031fdc6b5868 Mon Sep 17 00:00:00 2001 From: mathieu Date: Thu, 9 Jul 2015 13:27:55 -0400 Subject: [PATCH] Improve the regex for 24h hour format. #37 --- assets/js/application.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/assets/js/application.js b/assets/js/application.js index 932241b3..4958f23a 100755 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -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() { @@ -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');