File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ var main = function() {
8484 // Current Time
8585 var d2 = new Date ( ) ;
8686 var currentTime = d2 . getTime ( ) + ( d2 . getTimezoneOffset ( ) * 60000 ) - startTime ;
87-
87+
8888 // Convert miliseconds
8989 var seconds = currentTime / 1000 ;
9090 var minutes = seconds / 60 ;
@@ -93,7 +93,18 @@ var main = function() {
9393 // Get within current limits
9494 seconds = Math . floor ( seconds % 60 ) ;
9595 minutes = Math . floor ( minutes % 60 ) ;
96- hours = Math . floor ( hours % 24 ) ;
96+ console . log ( Math . floor ( hours ) , " --" , Math . floor ( hours % 24 ) ) ;
97+ if ( hours - 24 >= 0 )
98+ hours = Math . floor ( hours ) ;
99+ else
100+ hours = Math . floor ( hours % 24 ) ;
101+
102+ // Negative time protection
103+ if ( hours < 0 || minutes < 0 || seconds < 0 ) {
104+ d = new Date ( ) ;
105+ startTime = d . getTime ( ) + d . getTimezoneOffset ( ) * 60000 ;
106+ return ;
107+ }
97108
98109 // No-Life protection
99110 if ( hours >= 30 ) {
You can’t perform that action at this time.
0 commit comments