From de6e0f645faf5262f77ca92a3ea21956eb929277 Mon Sep 17 00:00:00 2001 From: Larvey <39219859+LarveyOfficial@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:05:28 -0400 Subject: [PATCH 1/2] Fix Sonarr Incorrect Dates Due to how Sonarr gives dates, they recommend using UTC time when displaying it as it matches their calendar. Took some digging but it fixed it. --- src/components/modules/calendar/CalendarModule.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index 4f3c9e492..e3e6123e3 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,27 +111,26 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.toDateString(); + const day = renderdate.getDate(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const sonarrFiltered = sonarrmedias.filter((media: any) => { - const date = new Date(media.airDate); - // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + const date = new Date(media.airDateUtc); + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); // Return true if the date is renerdate without counting hours and minutes - return date.toDateString() === day; + return date.getDate() === day && date.getMonth() === renderdate.getMonth(); }); if ( sonarrFiltered.length === 0 && From 4dac73041279c3a2cae88ce4bb4ac794d95475de Mon Sep 17 00:00:00 2001 From: ajnart Date: Wed, 8 Jun 2022 08:09:59 +0200 Subject: [PATCH 2/2] :twisted_rightwards_arrows: Rebase with dev --- src/components/modules/calendar/CalendarModule.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/modules/calendar/CalendarModule.tsx b/src/components/modules/calendar/CalendarModule.tsx index e3e6123e3..1272bbafb 100644 --- a/src/components/modules/calendar/CalendarModule.tsx +++ b/src/components/modules/calendar/CalendarModule.tsx @@ -111,26 +111,26 @@ function DayComponent(props: any) { props; const [opened, setOpened] = useState(false); - const day = renderdate.getDate(); + const day = renderdate.toDateString(); const readarrFiltered = readarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const lidarrFiltered = lidarrmedias.filter((media: any) => { const date = new Date(media.releaseDate); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const sonarrFiltered = sonarrmedias.filter((media: any) => { const date = new Date(media.airDateUtc); - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); const radarrFiltered = radarrmedias.filter((media: any) => { const date = new Date(media.inCinemas); // Return true if the date is renerdate without counting hours and minutes - return date.getDate() === day && date.getMonth() === renderdate.getMonth(); + return date.toDateString() === day; }); if ( sonarrFiltered.length === 0 &&