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] Option for start day of week to always be today #257

Closed astevens93 closed 3 years ago

astevens93 commented 4 years ago

Is your feature request related to a problem? Please describe. Taking the RadioStationDemo.com example, today is Friday, so the tabbed schedule looks this.

image

Describe the solution you'd like But to make this cleaner, and almost 'look forward' to any upcoming schedule overrides, would it be possible to make it so that the tabbed schedule defaults to 'today' being the first tab. I've edited the example to show you what i mean:

image

You could even go one further and change 'today's' tab to be 'Today'

image

Describe alternatives you've considered Not everyone might want this, but I feel it could enhance the tabbed schedule view, which I know is very popular.

Interested to hear your thoughts re a future release, or PRO version.

tonyzeoli commented 4 years ago

My first inclination is to say moving today's "day" is confusing if you leave off the word for the day. Because we are going to a by date calendar in PRO, which may carry over to FREE, like Gcal we're going to start the calendar on the current days date forward, so there's that aspect of what we plan to do.

So, I would say some iteration of this will happen, but it won't be as you've edited it. It will be more like a normal calendar starting on today's date. So, instead of just saying, Friday. It will say, Fri. Aug 7 and the year will be above the tabs.

You're thinking in the right direction, but this will change when we go PRO with a year over year calendar like Gcal.

astevens93 commented 4 years ago

Oh wow yes that sounds like a great idea. So it will load today’s date on the tabbed schedule and you’ll be able to scroll/click across into advance days. Look forward to this being included in the future. Will close this Now then as it seems this idea is already being worked on. Cheers.

majick777 commented 3 years ago

@astevens93 In following up on this, I've added a filter radio_station_schedule_start_day to which the value of today can now be passed (or any other weekday) - and this will override the existing Start of Week setting in WordPress so that the Schedule display will start on that day. Alternatively a value can also be passed to the Master Schedule shortcode as an attibribute eg. [master-schedule start_day="today"] (Note neither of this options will change the actual display value of that day to "Today" as discussed previously, but simply change the first column/tab for the View.)

astevens93 commented 3 years ago

Thanks @majick777. I have tried this with the latest dev version on my site with the shortcode attribute added in

[master-schedule view="tabs" show_link="0" show_desc="1" start_day="today"]

And it just re-arranges the days for me, making Sunday my first day of week (when default is Monday). Any ideas?

majick777 commented 3 years ago

@astevens93 Yep was just a typo there, added a hotfix to includes/support-functions.php try it now.

astevens93 commented 3 years ago

Brill, works great. Thank you.

majick777 commented 3 years ago

@astevens93 Just a heads up since you are using this, there is an issue with Overrides with this: https://github.com/netmix/radio-station/issues/274 So if you have Overrides you may want to revert back to standard display (no day_start attribute) until that is resolved.

astevens93 commented 3 years ago

Ok thanks @majick777. I must admit I’ve been trying to decipher the problem reported on Wordpress Forum and in #274 but I don’t understand. I tested making a test override for a week previous and it does not show in my tabbed schedule - which I think is the reported problem?

I am using =today as the start day and not a specific day, I cannot replicate the issue in Dev Version 2.3.3.5.

The only issue I notice when using =today and show date on the tabbed view, is that because the week is looking forward 7 days, it will show the full week and not the true day overrides.

For example in my view here CC881AE7-8F9D-42AE-8E97-094787B56F90 Switching to the tab ‘Friday 23rd Oct’ will show whatever Friday for the same week we are already in. So actually instead of showing w/c 19th Oct schedule for Friday, it will show the W/c 12th Oct schedule for Friday.

I believe that to be the way it’s designed rather than a bug as such. As by default tabbed view always looks at the 7 days in the week you are in, and start day and show date shortcode functions are not taking into account this when you are ‘looking forward 7 days’ visually.

Hope that makes sense.

majick777 commented 3 years ago

@astevens93 I've just added a hotfix for this issue (to master branch.) So that the week start and end dates are passed on to the schedule calculation from the shortcode. Feel free to test it out and follow up in #274