Jump to content

Customize calendar to display specific month?

Recommended Posts

  • 1 month later...
  • Replies 13
  • Views 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

On 7/2/2020 at 9:56 AM, digitalstu said:

Site URL: https://www.hollyhotlipshere.com/

Hello, does anyone know if there's a way of making a calendar view default to a different month other than the current one? So mine is obviously defaulting to July at the moment when the page loads, but I'd like it to appear as August 2020 as that's when all the relevant events will be.

calendar.JPG

I don't have an answer, but I'm also looking for a way to do this. Did you ever find a solution? Maybe tuanphan has a CSS solution that would work?

Link to comment
  • 4 months later...
  • 2 months later...
  • 2 weeks later...
  • 1 year later...
2 hours ago, mollym said:

is there any way to trick the calendar into showing only a certain month instead of the current month?

Please post the URL for a page on your site where we can see your issue.

If your site is not public please set up a site-wide password, if you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site. Please read the documentation at the link provided to understand how it works.

Please read the documentation at the link provided on how to share a link to your site to understand how it works. A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

We can then take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
On 7/13/2022 at 11:13 AM, mollym said:

is there any way to trick the calendar into showing only a certain month instead of the current month?

SS hardwired the start date to be the current date. I don't see a clean way to work around this issue.

Perhaps other do.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • 9 months later...
  • 2 months later...

A bit of a hack but you can programmatically click the month to "jump to" the month you need it. You can then attach this script to the page under the advanced section. 

 

<script>
  setTimeout(() => {
    const gotToNextMonthButtonEl = document.querySelector('a[role=button][aria-label="Go to next month"]');

    for (let i = 0; i < 20; i++) {
      const headerLabelEl = document.querySelector('[class*="calendar-header-label"]');
      if (headerLabelEl.textContent === 'April 2024') break;
      gotToNextMonthButtonEl.dispatchEvent(new MouseEvent('click'));
    }
  }, 500);
</script>

 

Link to comment

this was very useful, it works. But, I need a little more complicated thing. I want to see five months togheter one next to the other, from august to december. What would it be that script? Thanks!

Edited by PMLB
Link to comment
  • 1 month later...

I tried the above code and it didn't work. We are in August 2023, but need to jump to January 2024 as the first calendar shown. Any work around? 

Squarespace should've added this feature, since we all want to promote future events that would typically not be in the current month. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.