import {Saturday, Sunday}from '../constants/days'
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 ){
        value =  null;
    }
    else if(day === Saturday){
        value  = officeHours[SaturdayType];
    }
    else if(day === Sunday){
        value =  officeHours[SundayType];
    }
    else {
        value =  officeHours[WorkingDayType];
    }

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