Selaa lähdekoodia

Bug fixing for working hours

master
Nikola Ignjatovic 4 vuotta sitten
vanhempi
commit
d0e930b7bd
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7
    4
      src/helpers/GetTodaysWorkingHours.js

+ 7
- 4
src/helpers/GetTodaysWorkingHours.js Näytä tiedosto

@@ -3,17 +3,20 @@ import {WorkingDayType, SaturdayType,SundayType }from '../constants/workingHours

export default function getHours(officeHours) {
var day = new Date().getDay();
var value = null;
if(officeHours === undefined && officeHours.length < 3 ){
return null;
value = null;
}
else if(day === Saturday){
return officeHours[SaturdayType].hours;
value = officeHours[SaturdayType];
}
else if(day === Sunday){
return officeHours[SundayType].hours;
value = officeHours[SundayType];
}
else {
return officeHours[WorkingDayType].hours;
value = officeHours[WorkingDayType];
}

return value !== null && value !==undefined ? value.hours: null ;
}

Loading…
Peruuta
Tallenna