File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 77 now supports Adjust Clock widget, if installed
880.06: Minor code improvements
990.07: Bangle2: Shift the position of one line on the screen
10+ 0.08: Bangle1: fix scoping of variables `time` and `wait`
Original file line number Diff line number Diff line change @@ -159,20 +159,22 @@ function drawTime()
159159 let date = "" ;
160160 let timeDef ;
161161 let x = 0 ;
162+ let time ;
163+ let wait ;
162164 dt . setDate ( dt . getDate ( ) ) ;
163165 if ( addTimeDigit ) {
164166 x =
165167 10368 * dt . getHours ( ) + 172.8 * dt . getMinutes ( ) + 2.88 * dt . getSeconds ( ) + 0.00288 * dt . getMilliseconds ( ) ;
166168 let msg = "00000" + Math . floor ( x ) . toString ( 12 ) ;
167- let time = msg . substr ( - 5 , 3 ) + "." + msg . substr ( - 2 ) ; //TODO: should `time` and `wait` have been defined outside the if block?
168- let wait = 347 * ( 1 - ( x % 1 ) ) ;
169+ time = msg . substr ( - 5 , 3 ) + "." + msg . substr ( - 2 ) ;
170+ wait = 347 * ( 1 - ( x % 1 ) ) ;
169171 timeDef = time6 ;
170172 } else {
171173 x =
172174 864 * dt . getHours ( ) + 14.4 * dt . getMinutes ( ) + 0.24 * dt . getSeconds ( ) + 0.00024 * dt . getMilliseconds ( ) ;
173175 let msg = "0000" + Math . floor ( x ) . toString ( 12 ) ;
174- let time = msg . substr ( - 4 , 3 ) + "." + msg . substr ( - 1 ) ;
175- let wait = 4167 * ( 1 - ( x % 1 ) ) ;
176+ time = msg . substr ( - 4 , 3 ) + "." + msg . substr ( - 1 ) ;
177+ wait = 4167 * ( 1 - ( x % 1 ) ) ;
176178 timeDef = time5 ;
177179 }
178180 if ( lastX > x ) { res = getDate ( dt ) ; } // calculate date once at start-up and once when turning over to a new day
Original file line number Diff line number Diff line change 22 "id" : " doztime" ,
33 "name" : " Dozenal Digital Time" ,
44 "shortName" : " Dozenal Digital" ,
5- "version" : " 0.07 " ,
5+ "version" : " 0.08 " ,
66 "description" : " A dozenal Holocene calendar and dozenal diurnal digital clock" ,
77 "icon" : " app.png" ,
88 "type" : " clock" ,
You can’t perform that action at this time.
0 commit comments