Support

Home Forums Event Espresso Premium Limit calendar view to "current and future" day/week/month

Limit calendar view to "current and future" day/week/month

Posted: May 30, 2022 at 7:44 pm

Viewing 5 reply threads


tethac01

May 30, 2022 at 7:44 pm

Hi,

On the EE Calendar, we would like to stop people to see “past” events.
That is when they navigate to the calendar, they can see the current month, week or day, but they can also navigate “back” in time and see past events.

Is there some way to stop that?
I was thinking about hiding the “back” button, however that then is an issue when users navigate “forward” and then want to navigate back to the current time.
I also thought about listening to URL parameters (but there are none), or listening to “Click” on “next” and show the back button only then. yet that also is not ideal, since then they could navigate next, and then infinitely backwards.

Do you have any code solution we can use? Perhaps a hook that I can use to stop back-navigation from the current day/month/week to past times?

Thanks!


Joao Victor

  • Support Staff

May 31, 2022 at 6:41 pm

Hi there!

Thanks for contacting us.

To check your setup, could you please provide the website details through this URL:https://eventespresso.com/send-login-details/ ?

Thanks!


tethac01

May 31, 2022 at 8:15 pm

Hi Joao, thanks for your reply.

I am not sure why login details are required for this support request.

Let me explain it again:
On this site https://thecrafterybar.com/reservations/ there is a calendar of events.
On the top left of the calendar there is a “back” button.
This allows the competition to sneak through past events of this business.
The business owner wants to avoid that and thus, make it impossible for visitors to “navigate back” in the events calendar.

Of course, folks should be able to book, and thus navigate _forward_ in to the future. Thus, I cannot just hide the back button with CSS since it would become impossible to navigate back once a visitor has navigated forward.
I can also not listen to some URL parameters since the plugin updates the calendar with AJAX and theres no URL parameters indicating the current view.

My question as a developer working for said business is, if there is some hook, or perhaps JS event, that we can use to hide the back button on first page load, but show it when folks are navigating forwards, and hide it again when they reach the “current month”.

This should be a fairly common request from a business point of view I guess, and I was wondering if you have some options or suggestions to do that.

Thank you.


Tony

  • Support Staff

June 2, 2022 at 3:58 am

Hi there,

We don’t need login credentials for this ๐Ÿ™‚

The calendar does indeed have the option for hiding expired events by using a shortcode parameter, on the above page change the shortcode to use the show_expired parameter, like this:

[ESPRESSO_CALENDAR show_expired=false]

That should remove them from the query rather than hiding/removing them afterwards.


tethac01

June 5, 2022 at 9:40 pm

Excellent, thanks a lot, this worked just fine.


Tony

  • Support Staff

June 6, 2022 at 6:07 am

You’re most welcome.

Any further questions just let us know ๐Ÿ™‚

Viewing 5 reply threads

The support post ‘Limit calendar view to "current and future" day/week/month’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso