Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/homepage/commit/518ed7fc4e19d5e2df017021ed5a8094ab2f5925 You should set ROOT_URL correctly, otherwise the web may not work correctly.

Feature: Support previous days option in Calendar Agenda ()

Signed-off-by: Denis Papec <denis.papec@gmail.com>
pull/2376/head
Denis Papec 1 year ago committed by GitHub
parent acafbb5100
commit 518ed7fc4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,6 +33,7 @@ widget:
type: calendar
view: agenda
maxEvents: 10 # optional - defaults to 10
previousDays: 3 # optional - shows events since three days ago - defaults to 0
integrations: # same as in Monthly view example
```

@ -351,6 +351,7 @@ export function cleanServiceGroups(groups) {
firstDayInWeek,
integrations,
maxEvents,
previousDays,
view,
// coinmarketcap
@ -517,6 +518,7 @@ export function cleanServiceGroups(groups) {
if (firstDayInWeek) cleanedService.widget.firstDayInWeek = firstDayInWeek;
if (view) cleanedService.widget.view = view;
if (maxEvents) cleanedService.widget.maxEvents = maxEvents;
if (previousDays) cleanedService.widget.previousDays = previousDays;
}
}

@ -48,7 +48,9 @@ export default function Agenda({ service, colorVariants, showDate }) {
const eventsArray = Object.keys(events)
.filter(
(eventKey) => showDate.startOf("day").toUnixInteger() <= events[eventKey].date?.startOf("day").toUnixInteger(),
(eventKey) =>
showDate.minus({ days: widget?.previousDays ?? 0 }).startOf("day").ts <=
events[eventKey].date?.startOf("day").ts,
)
.map((eventKey) => events[eventKey])
.sort((a, b) => a.date - b.date)

Loading…
Cancel
Save