Skip to content

fix(dashboard): show all-day events correctly in calendar widget#8545

Open
stephan1827 wants to merge 1 commit into
nextcloud:mainfrom
stephan1827:fix/allday-events-in-dashboard-widget
Open

fix(dashboard): show all-day events correctly in calendar widget#8545
stephan1827 wants to merge 1 commit into
nextcloud:mainfrom
stephan1827:fix/allday-events-in-dashboard-widget

Conversation

@stephan1827

Copy link
Copy Markdown

Summary

The dashboard calendar widget had two bugs with all-day (VALUE=DATE) events:

  • Hidden all day: All-day events are stored as midnight UTC (00:00:00). The widget compared DTSTART.timestamp >= now, which always fails after midnight UTC, effectively hiding today's all-day events for the entire day.
  • Wrong label: All-day events were displayed with formatTimeSpan(), showing e.g. "in 10 hours" instead of something meaningful.

Changes

  • Detect all-day events by checking whether the DTSTART time component is 00:00:00 (standard VALUE=DATE) or 23:59:59 (used by some third-party ICalendar providers as a forward-compatibility signal).
  • For all-day events, compare by calendar date (Y-m-d) instead of timestamp, so today's events are always included.
  • Show "All day" as the subtitle instead of a formatted time span.

Test plan

  • Add an all-day event to a calendar for today → verify it appears in the dashboard widget with label "All day"
  • Add an all-day event for a future date → verify it appears with label "All day"
  • Add a timed event → verify it still shows the relative time span (e.g. "in 2 hours")
  • Verify today's all-day event is not shown once the day has passed (next day)

🤖 Generated with Claude Code

The CalendarWidget compared DTSTART timestamps with the current time,
which caused all-day events (VALUE=DATE, stored as midnight UTC) to be
excluded once the clock passed midnight — effectively hiding them all day.

Additionally, all-day events were displayed with a time span like
"in 10 hours" instead of a meaningful label.

This fix detects all-day events by checking whether the DTSTART time
component is 00:00:00 (standard VALUE=DATE) or 23:59:59 (used by some
third-party providers as a compatibility signal). For these events:
- Use a date-based comparison instead of a timestamp comparison so that
  today's all-day events are always shown.
- Display "All day" as the subtitle instead of a formatted time span.

Signed-off-by: Stephan Stricker <stephan@stricker.cloud>
Signed-off-by: stephan1827 <stephan@stricker.cloud>
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant