netmix / radio-station

Radio Station WordPress Plugin (Open Source)
https://netmix.com
GNU General Public License v3.0
19 stars 14 forks source link

[ Schedule ] Displays Oct 31 two days in a row #391

Closed tonyzeoli closed 2 years ago

tonyzeoli commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

A user in the free support forum states that Oct 31 displays on two consecutive days. I've confirmed at this URL https://www.uckfieldfm.co.uk/on-air/schedule/

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.uckfieldfm.co.uk/on-air/schedule/
  2. Navigate to Oct 31
  3. See Sunday and Monday are both the 31st.

Expected behavior A clear and concise description of what you expected to happen.

Monday should be November 1st.

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

astevens93 commented 2 years ago

Just to clarify, I have the same issue https://www.hcrfm.co.uk/on-air/schedule/

kairandles commented 2 years ago

Same issue on both of my websites too

tonyzeoli commented 2 years ago

@kairandles @astevens93 Thanks! Yep, it's definitely a bug. I've notified @majick777 and we'll get a fix out for this asap.

majick777 commented 2 years ago

@tonyzeoli @kairandles @astevens93 Certainly a strange one. I suspect it may have something to do with daylight savings times starting/ending at the end of the month? I can't seem to reproduce locally, but in any case, I've changed the date calculations in the tabbed schedule to use 2am instead of midnight to work out the week's dates, and added an extra check to the weekdate calculation function to try to make sure there aren't ever two consecutive dates.

Added the fix to the latest development branch for testing. We are about to push 2.4.0.4 so would be good to have this fix in this release, so let me know if it worked.

mj187 commented 2 years ago

@majick777 @tonyzeoli - Thanks as ever for your quick action on this. Has it been commited to the latest dev version? I don't see the fix?

tonyzeoli commented 2 years ago

Looks like he said it was, but maybe something didn't take before he went to bed for the night. Let's see what he says around 8 pm EST tonight.

On Thu, Oct 28, 2021 at 2:16 PM mj187 @.***> wrote:

@majick777 https://github.com/majick777 @tonyzeoli https://github.com/tonyzeoli - Thanks as ever for your quick action on this. Has it been commited to the latest dev version? I don't see the fix?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/netmix/radio-station/issues/391#issuecomment-954086313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA65WO3MTY6BCZT35PKHAI3UJGOPRANCNFSM5GZFCXGA .

majick777 commented 2 years ago

@mj187 Yes in the develop branch, templates/master-schedule-tabs.php I added two hours to the date calculation, and in includes/support-functions.php the function radio_station_get_weekdates has been modified to try to catch and prevent duplicate dates.

So it's there but possible that my attempt has had no affect. Again, without being able to reproduce the problem, it's hard to know if I've managed to fix it. Usually I can reproduce but this is rather strange as it probably is some combination with the current time of day, when the schedule is set to start, timezone and daylight saving starting/ending.

If you've tried the latest develop version and are saying it didn't change anything, I will have another go at it.

majick777 commented 2 years ago

@mj187 To double check, I took the weekdate data from your site and ran it through the patched radio_station_get_schedule_weekdates function and it worked for me to successfully remove the duplicate sequential dates.

mj187 commented 2 years ago

Thankyou again @majick777 and apologies, in my haste I had taken the current master again! I've now taken the dev branch and the issue is fixed.

Appreciate it.

majick777 commented 2 years ago

@mj187 @kairandles @astevens93 Great, closing this out. Included in 2.4.0.4 release which will be out shortly.