atomic-calendar-revive icon indicating copy to clipboard operation
atomic-calendar-revive copied to clipboard

[FEATURE] Show events for the upcoming X weeks

Open xPhantomNL opened this issue 3 years ago • 4 comments

There is a filter to show the next X days (maxDaysToShow) but a filter to show weeks would be nice as well.

Expected behaviour

Ideally it would take observe the firstDayOfWeek setting as well. The idea is, that if I (for example) set the new configuration option to 1, it would show all events from this week and no events from next week. If I were to set it to 3, it would show events from this week, next week and the week after

Current behaviour

There is no current option for this as far as I could find in the docs. I have set maxDaysToShow to 7, but that hides the past events and does show the upcoming events.

Checklist

  • [X] I searched the current issues and the feature is not known.
  • [X] I am mostly sure that the feature will bring more good than bad.

xPhantomNL avatar May 23 '21 17:05 xPhantomNL

Hi @xPhantomNL ,

sorry for the slowness here, why wouldnt you just set the maxDaysToShow to 21 which would then show 3 weeks?

Or do you want it to show the full week even if the day has passed?

marksie1988 avatar Oct 14 '21 20:10 marksie1988

Yes, pretty much the last one. I have a formula 1 calendar, I would like it to only show the events from the current week. If I were to set the maxDaysToShow to a higher number, it would also show the events from the next week, if there's a race next week. Ideally, it would still show the calendar events from the past days of the current week.

I would need one of these;

  • Show all events from this week only
  • Show all events from the upcoming X weeks, where X is a variable

xPhantomNL avatar Oct 15 '21 22:10 xPhantomNL

I think there should be a maxWeeksToShow config. If it's 1, show all events from today, or startDaysAhead, if specified, up until and including the day before firstDayOfWeek. A setting of two would be the rest of this week, plus all of next week, etc.

What should happen if a user specifies both maxDaysToShow and maxWeeksToShow. I think the options are:

  • maxDaysToShow could take priority
  • maxWeeksToShow could take priority
  • Whichever resulted in a shorter window could take priority
  • Whichever resulted in a longer window could take priority

I can't think of any good reason or use case for setting both, so I'm partial to the first option.

Right now firstDayOfWeek is a calendar mode-specific setting. Should it be a main option so that this feature can be used with event mode? Or should this feature also only apply to calendar-mode? Another alternative is getting a locale-aware first day of week using the weekday plugin of dayjs.

atlflyer avatar Oct 27 '21 21:10 atlflyer

@atlflyer,

I would say create an option maxWeeksToShow this will show all events for that week starting on the firstDayOfWeek ending the day before, this way even if an event has passed it would show. e.g. it shows the full week not a rolling week.

The only issue I would see here is when you get to the last day of the week you wouldn't know what event was on the following week if set to 1 week.

firstDayOfWeek is locale aware already, however the option for a user to change it based on their preference is there, this was only implemented in the calendar as "weeks" dont currently apply to the event mode, however if we were to implement this then obviously the firstDayOfWeek is relevant in both modes so would become a main option.

marksie1988 avatar Oct 28 '21 08:10 marksie1988