Question: Is it possible to responsively switch between month and week view?

Created on 25 October 2023, over 1 year ago
Updated 17 January 2024, over 1 year ago

Problem

I am constructing a page on my site that lets users view a calendar of change requests. On desktop mode, the month view is far better than week view for my needs, but when the site is on a mobile screen, the month calendar is being squeezed and is nearly unusable. For that purpose, week view would be better for me.

When I set up the calendar view, it let me pick between the two, but I am looking for an automatic solution where it displays as week view for small screens, and month view above a certain threshold. Can this be achieved gracefully using the calendar view module?

Non-graceful solution

I came up with a possible alternative, which is to build two calendar blocks; One weekly, and one monthly. Then the unneeded calendar can just be hidden with CSS and a media query.

I am not sure if this is a good idea though as it may slow down the site to load two different calendars with the same data. I would prefer a solution that changed the format of the calendar (and pager functionality) to automatically switch between week & month view. Does anybody know if this can be done, or if there is a better alternative than the one I came up with above?

💬 Support request
Status

Closed: works as designed

Version

2.1

Component

Code

Created by

🇨🇦Canada ciesinsg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ciesinsg
  • Status changed to Closed: works as designed over 1 year ago
  • Thank you for reporting this request.

    AFAIK it is not possible for a View to render a different display responsively (e.g. switching between display based on screen size).

    IMHO your "non-graceful" solution is the only solution.

Production build 0.71.5 2024