Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing .fc-event-past and isPast is false on events ending yesterday #6486

Closed
r20 opened this issue Jul 28, 2021 · 5 comments
Closed

Missing .fc-event-past and isPast is false on events ending yesterday #6486

r20 opened this issue Jul 28, 2021 · 5 comments

Comments

@r20
Copy link

r20 commented Jul 28, 2021

Reduced Test Case

Bug can be seen at https://codepen.io/r20-the-styleful/pen/RwVMgey

Bug Description

With the dayGridMonth view, an event on the day before today does not have the .fc-event-past css class.
See the codepen reproduction, on "month" view. A css rule reduces opacity for fc-event-past and you can see "Yesterday event" does not have that class.
As a workaround, I thought of using .fc-day.past, but that won't work for cases like the event titled "Yesterday and today" because although it's within the td.fc-day-past it spans to today so it should NOT have .fc-event-past.

I noticed this in the listMonth and listWeek views as well. The timeGridWeek view seems to work as expected.

@acerix acerix changed the title Missing .fc-event-past for yesterday's past events. Missing .fc-event-past class on events ending yesterday Jul 29, 2021
@acerix
Copy link
Member

acerix commented Jul 29, 2021

It seems like a bug, the comparison for isPast should use <= since end dates are exclusive:

isPast: segRange.end < (nowDate || todayRange.start),

As a workaround you can set a class from eventClassNames:

https://codepen.io/acerix/pen/gOWzbPQ?editors=0010

@acerix acerix changed the title Missing .fc-event-past class on events ending yesterday Missing .fc-event-past and isPast is false on events ending yesterday Jul 29, 2021
@camsteffen
Copy link

Related or same issue: #6120

@fnagel
Copy link

fnagel commented Jul 18, 2023

I can confirm this bug in v5.11.4 and the workaround provided by @acerix. Any chance for a bugfix in the actual code?

If you need the internal variables to be fixed too, try this:

eventClassNames: function(arg) {
    const end = arg.event.end ?? arg.event.start;
    
    if (end <= todayStart) {
      arg.isPast = true;
      arg.event.isPast = true;
      return 'fc-event-past';
    }
  },    

@simoncodearcs
Copy link

simoncodearcs commented Jan 29, 2024

+1 this is still an issue.
Recently upgraded to v6.1.10 and decided to leverage the isPast boolean instead of calculating whether an event was in the past. Think I'll revert to previous calculations.
Did notice that the issue only occurs on the month view and list view, the week grid and day grid render correctly.

@arshaw arshaw modified the milestones: next-release, next-release-temp Feb 6, 2024
@arshaw
Copy link
Member

arshaw commented Feb 20, 2024

This has been fixed in v6.1.11

Updated repro:
https://codepen.io/arshaw/pen/ZEPZovW

@acerix , your assessment of the bug was correct, thanks!

@arshaw arshaw closed this as completed Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants