nextcloud / nextcloud/calendar

Configurable date range in widget

Open
#4,996 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement Feature: Dashboard
Dominant language
JavaScript
Stars
1.2k
Forks
332
Avg merge
16h 13m
Merged PRs (30d)
137

Description

Is your feature request related to a problem? Please describe.

Our organization has very few but important events spread over the year. When I enter them into shared calendar, the events do not appear in the widget until 14 days before. Which is far too short to alert members of them, while leaving a lot of unnecessary empty space on the widget.

Examining the source code, it appears the Calendar app has a hard-coded range of dates to show events in the widget:

$inTwoWeeks = $dateTime->add(new DateInterval('P14D'));
$options = [
        'timerange' => [
                'start' => $dateTime,
                'end' => $inTwoWeeks,
        ]
];
Describe the solution you'd like

Maybe a config/config.php setting could be introduced to make this configurable:

'calendar.widget.date_range' => 'P1Y',

There is still a number limit (default to 5) of maximum events shown, which shall prevent flooding the widget with too many events when using long date ranges.

Describe alternatives you've considered

I've tried to change the PHP source code, but due to Nextcloud app signing and caching, I was unable to change the date range of events shown in the widget.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find the widget code containing the hard-coded P14D range and review config/config.php handling before deciding how a date-range setting should be exposed. Confirm the implementation supports a configurable range while retaining the default five-event limit, then verify the widget behavior with an appropriate existing test or manual calendar data.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.