Permalink
Browse files

fixed bug causing to fail during 12:00-12:59 am

  • Loading branch information...
1 parent cefd232 commit d90d12eec39bd97fab4e490ffae571dfdafde427 @zackdever committed Sep 16, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 time.js
View
@@ -35,7 +35,8 @@
// set to current time
var d = new Date()
, hours = d.getHours();
- this.hours = hours > 11 ? hours - 12 : hours;
+ this.hours = hours > 12 ? hours - 12 : hours;
+ if (this.hours === 0) this.hours = 12;
this.minutes = d.getMinutes();
this.period = hours > 11 ? pm : am;
}

0 comments on commit d90d12e

Please sign in to comment.