Skip to content

Commit

Permalink
24h hours format is now enforced on the measures / accuracy pages. #37
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Jul 7, 2015
1 parent 4ec5c78 commit 5362d81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright 2015 ToolwatchApp
*/

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

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

if(/\d+:\d+:\d+/.test(userTime))
console.log(hoursRegExp.test(userTime));

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

Expand Down Expand Up @@ -346,7 +350,7 @@ $(document).ready(function()
// Timezone difference from Europe/Paris
var userTimezone= (myDate.getTimezoneOffset()/60)+1;

if(/\d+:\d+:\d+/.test(userTime))
if(hoursRegExp.test(userTime))
{
$('.btn-spinner i').css('display', 'inline-block');

Expand Down

0 comments on commit 5362d81

Please sign in to comment.