mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-19 19:19:50 +00:00
Feature: Support previous days option in Calendar Agenda (#2375)
Signed-off-by: Denis Papec <denis.papec@gmail.com>
This commit is contained in:
parent
acafbb5100
commit
518ed7fc4e
3 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue