hi community,
i have this problem and could not formulate a logic regarding dates/days. the scenarion is:
i have a search feature on my site and a filter for dates. in the dropdown, i have items from Monday to Sunday. if today is Wednesday then i selected "Monday" from the list, what i will get is the result for Monday the following week.same goes if i select "Tuesday". BUT if i select Wednesday, Thursday, Friday, Saturday, Sunday, i wll be able to get results from this week. i hope someone could provide me a logic as i hae spent 2 days doing this.
thanks in advance
help with day today and yesterday
Moderator: General Moderators
Re: help with day today and yesterday
Have your select list dynamically generated based on the current day, and have the value be the number of days ahead of today. From there, just use DateTime::modify().