@@ -20,21 +20,21 @@ declare let currentHour: number;
2020const days = [ "Sun" , "Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" ] ;
2121const months = [ "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ] ;
2222
23- function loc ( key )
23+ function loc ( key : string ) : string
2424{
2525 return dict [ key ] ?? key ;
2626}
2727
28- function totwo ( num )
29- {
30- if ( num < 10 )
31- {
32- return "0" + num ;
33- }
34- return num ;
35- }
28+ function totwo ( num : number ) : string
29+ {
30+ if ( num < 10 )
31+ {
32+ return "0" + num ;
33+ }
34+ return num . toString ( ) ;
35+ }
3636
37- function formattz ( offset )
37+ function formattz ( offset : number ) : string
3838{
3939 if ( offset == 0 )
4040 {
@@ -49,7 +49,7 @@ function formattz(offset)
4949}
5050document . getElementById ( "local-time-option" ) . textContent += " (" + formattz ( new Date ( ) . getTimezoneOffset ( ) ) + ")" ;
5151
52- function formathour ( hour )
52+ function formathour ( hour : number ) : string
5353{
5454 switch ( ( document . getElementById ( "select-hourfmt" ) as HTMLSelectElement ) . value )
5555 {
@@ -111,7 +111,7 @@ Promise.all([
111111 onLanguageUpdate ( ) ;
112112} ) ;
113113
114- function updateFilterNamesForLocale ( )
114+ function updateFilterNamesForLocale ( ) : void
115115{
116116 document . querySelector ( "label[for=filter-MT_SURVIVAL]" ) . textContent = toTitleCase ( dict [ "/Lotus/Language/Missions/MissionName_Survival" ] ) ;
117117 document . querySelector ( "label[for=filter-MT_DEFENSE]" ) . textContent = toTitleCase ( dict [ "/Lotus/Language/Missions/MissionName_Defense" ] ) ;
@@ -132,7 +132,7 @@ function updateFilterNamesForLocale()
132132 document . querySelector ( "label[for=filter-FC_MITW]" ) . textContent = dict [ "/Lotus/Language/Game/Faction_MITW" ] ;
133133}
134134
135- function updateLog ( )
135+ function updateLog ( ) : void
136136{
137137 console . time ( "updateLog" ) ;
138138
@@ -281,7 +281,7 @@ function updateLog()
281281 console . timeEnd ( "updateLog" ) ;
282282}
283283
284- function saveSettings ( )
284+ function saveSettings ( ) : void
285285{
286286 let hash = "days=" + encodeURIComponent ( ( document . getElementById ( "select-days" ) as HTMLSelectElement ) . value )
287287 + "&tz=" + encodeURIComponent ( ( document . getElementById ( "select-tz" ) as HTMLSelectElement ) . value )
0 commit comments