I am trying to create a button that displays what shops are open at the time I push the button. I am using filterJSON: Function() to filter out the times that are open but I can't seem to get the loop to display just the open times. I know what I need to do to create the button but can't figure out a way to just display open times at the the current time.
var hours = feature.properties.hours;
for (y = 0; y < hours.length; y++) {
var normalizeHours= hours[y].replace(/\s/g, '').toLowerCase();
if (watcher.indexOf(normalizeHours) !== -1) {
return feature;
}
}`
JSON is below
hours: {
monday: {
close: "18:00:00",
open: "10:00:00",
call: false
},
tuesday: {
close: "18:00:00",
open: "12:00:00",
call: true
},
friday: {
close: "None",
open: "None",
call: false
},
wednesday: {
close: "18:00:00",
open: "17:00:00",
call: false
},
thursday: {
close: "None",
open: "None",
call: true
},
sunday: {
close: "18:00:00",
open: "15:33:00",
call: false
},
saturday: {
close: "18:00:00",
open: "15:00:00",
call: false
}
},