File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,8 @@ const dom = function dom() {
3333 helpers ( ) . addInnerText ( 'wind' , `<i class="fas fa-wind text-warning my-2"></i> ${ data . wind . speed } meter/sec` ) ;
3434 helpers ( ) . addInnerText ( 'windDir' , `<i class="fas fa-compass text-warning my-2"></i> ${ data . wind . deg } degrees` ) ;
3535 helpers ( ) . addInnerText ( 'clouds' , `<i class="fas fa-cloud text-warning my-2"></i> Clouds: ${ data . clouds . all } %` ) ;
36- helpers ( ) . addInnerText ( 'sunrise' , ' <i class="fas fa-sun text-warning my-2"></i> ' + ` Sunrise: ${ new Date ( ( data . sys . sunrise + data . timezone ) * 1000 ) . toUTCString ( ) . slice ( - 11 , - 7 ) } AM`) ;
37- helpers ( ) . addInnerText ( 'sunset' , ' <i class="fas fa-sun text-warning my-2"></i> ' + ` Sunset: ${ new Date ( ( data . sys . sunset + data . timezone ) * 1000 ) . toUTCString ( ) . slice ( - 11 , - 7 ) } PM`) ;
36+ helpers ( ) . addInnerText ( 'sunrise' , ` <i class="fas fa-sun text-warning my-2"></i> Sunrise: ${ new Date ( ( data . sys . sunrise + data . timezone ) * 1000 ) . toUTCString ( ) . slice ( - 11 , - 7 ) } AM`) ;
37+ helpers ( ) . addInnerText ( 'sunset' , ` <i class="fas fa-sun text-warning my-2"></i> Sunset: ${ new Date ( ( data . sys . sunset + data . timezone ) * 1000 ) . toUTCString ( ) . slice ( - 11 , - 7 ) } PM`) ;
3838 }
3939
4040 function imageSwitch ( data , id ) {
@@ -126,7 +126,7 @@ const dom = function dom() {
126126 cont . appendChild ( card ) ;
127127 row . appendChild ( cont ) ;
128128
129- for ( let i = 0 ; i < color . length ; i ++ ) {
129+ for ( let i = 0 ; i < color . length ; i += 1 ) {
130130 color [ i ] . style = 'background-color: rgba(255,255,255,0.1);' ;
131131 }
132132
Original file line number Diff line number Diff line change 1+ /* eslint-disable no-alert */
2+ /* eslint-disable no-console */
13import dom from './dom' ;
2- import helpers from './helpers' ;
34
45const events = function events ( ) {
56 function showFlow ( data ) {
@@ -33,7 +34,6 @@ const events = function events() {
3334 function getLocation ( searchBar ) {
3435 const city = ( document . getElementById ( searchBar ) . value ) . toLowerCase ( ) ;
3536 getSearch ( city ) ;
36- helpers ( ) . getFahrenheit ( city ) ;
3737 }
3838
3939 async function getForecast ( ) {
Original file line number Diff line number Diff line change 1+ /* eslint-disable consistent-return */
2+ /* eslint-disable no-alert */
3+ /* eslint-disable no-console */
14
25const helpers = function helpers ( ) {
36 const createElement = function createElement ( tag , className ) {
@@ -15,7 +18,8 @@ const helpers = function helpers() {
1518
1619 const addInnerText = function addInnerText ( className , text ) {
1720 const element = document . getElementById ( className ) ;
18- return element . innerHTML = text ;
21+ element . innerHTML = text ;
22+ return element . innerHTML ;
1923 } ;
2024
2125 async function getFahrenheit ( city ) {
You can’t perform that action at this time.
0 commit comments