Hi!I have a problem, in which I need to filter shops by name and by weekdays. Filtering by name is done. Now, i have a big problem when it comes to weekdays. Example:[{name: "Bob's shop",hours: "Mon-Thu, Sun 11:30 am - 9:30 pm / Fri-Sat 11:30 am - 10 pm"},{name: "Karen's shop",hours: "Mon - Tues 4:30 pm - 11:15 pm / Weds - Thurs 10:15 am - 5 pm / Fri 5:15 am - 8:30 pm / Sat - Sun 10 am - 2:30 am"}....]This is a large array of objects. First step would be to split("/") I guess, to break the hours into an array with the different timings. Since I ultimately need to filter by weekdays and time however, I have a hard time to think of a way to standardize the days. They are highly irregular. One time "Thu", then "Thur", "Thursday" and then mixed with other characters "Mon - Thur" or "Mon-Thu" etc. Any idea how to solve this issue and break up the weekdays or chunks of day with their respective timings?
Submitted June 18, 2020 at 04:15PM by RobSG
No comments:
Post a Comment