File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ function msToDayHours(ms) {
55 return d . getHours ( ) + d . getMinutes ( ) / 60 ;
66}
77function dayHoursToStr ( t ) {
8- return Math . floor ( t ) + ":" + Math . round ( ( t - Math . floor ( t ) ) * 60 ) . toString ( ) . padStart ( 2 , 0 ) ;
8+ t = Math . round ( t * 60 ) / 60 ;
9+ var hrs = Math . floor ( t ) ;
10+ return hrs + ":" + Math . round ( ( t - hrs ) * 60 ) . toString ( ) . padStart ( 2 , 0 ) ;
911}
1012function getDayStart ( ) {
1113 return new Date ( ( new Date ( ) ) . toISOString ( ) . substr ( 0 , 10 ) ) . getTime ( ) ;
@@ -57,7 +59,7 @@ function showTides() {
5759}
5860
5961function showMenu ( ) {
60- let step = 5 / 60 ;
62+ let step = 20 / 60 ;
6163 E . showMenu ( {
6264 "" :{ title :"Tides" , back : showTides } ,
6365 "Low Tide" : {
@@ -68,7 +70,7 @@ function showMenu() {
6870 let dayStart = getDayStart ( ) ;
6971 let currHr = msToDayHours ( Date . now ( ) ) ;
7072 if ( v + 1 < currHr ) v += 24 ;
71- tide . offset = dayStart + ( v + tide . period / 2 ) * 3600000 ;
73+ tide . offset = dayStart + v * 3600000 + tide . period / 2 ;
7274 tide . save ( ) ;
7375 showTides ( ) ;
7476 }
You can’t perform that action at this time.
0 commit comments