This one is baking my noodle big time!
I have some arrays inside an array that looks like this
var lidHours = {"192611":[
["07:00","21:30"],
["07:00","21:30"],
["07:00","21:30"],
["09:00","21:30"],
["09:00","00:00"],
["08:00","08:00"],
["",""]
]
}
And an array of the week days
var weekDays = new Array("Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun");
So each array represents a day of the week. I'm outputting onto the page like this: Monday: 7:00 - 21:00 and so on...
But you can see that the first 3 days have the exact same hours, my goal is to have it display like this:
Mon-Wed: 7:00 - 9:00
Thu: 9:00 - 9:30
Fri: 9:00 - 12:00
Sat: 8:00 - 8:00
Sun: Closed
I can format the hours and know when they are closed and convert from military to standard, but I cant figure out how to combine the duplicate hours(Mon-Wed) and how can I preserve Mon and know that the last duplicate day was Wed??
Any help would be so greatly appreciated. Thanks!
Now you can display combined_hours.