I have an array with elements representing different events. I need to rotate those based on the current month / day so that upcoming events are right on top of the list while the past ones are at the bottom moving forward as the month / day of the event is getting closer.
The year is not relevant and also the format of the date is for demonstration purposes only.
Thank you for your reply. Basically it’ll be the same events repeating year after year so January should be in the past if not current month. Data is coming from a database (WordPress) and it can be formatted any way you would think.
As a more explicit example:
Event for 29th of June
Event description
Event for 12th of July
Event description
Event for 24th of August
…
Event for 11th of December
…
Event for 06th of January
…
And so on the events of June, July, August, December goes at the back and January, February, etc, will be on top the next beginning of the year . This will cycle each year.
Thank you for your reply. This is how I thought about it in the first place but will this work with pagination if there’s going to be more than just a few events? I am sorry but I just can’t wrap my mind around this and just can’t feel which way would go better.