mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
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.
This commit is contained in:
@@ -111,27 +111,26 @@ function DayComponent(props: any) {
|
|||||||
props;
|
props;
|
||||||
const [opened, setOpened] = useState(false);
|
const [opened, setOpened] = useState(false);
|
||||||
|
|
||||||
const day = renderdate.toDateString();
|
const day = renderdate.getDate();
|
||||||
|
|
||||||
const readarrFiltered = readarrmedias.filter((media: any) => {
|
const readarrFiltered = readarrmedias.filter((media: any) => {
|
||||||
const date = new Date(media.releaseDate);
|
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 lidarrFiltered = lidarrmedias.filter((media: any) => {
|
||||||
const date = new Date(media.releaseDate);
|
const date = new Date(media.releaseDate);
|
||||||
// Return true if the date is renerdate without counting hours and minutes
|
// 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 sonarrFiltered = sonarrmedias.filter((media: any) => {
|
||||||
const date = new Date(media.airDate);
|
const date = new Date(media.airDateUtc);
|
||||||
// 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 radarrFiltered = radarrmedias.filter((media: any) => {
|
const radarrFiltered = radarrmedias.filter((media: any) => {
|
||||||
const date = new Date(media.inCinemas);
|
const date = new Date(media.inCinemas);
|
||||||
// Return true if the date is renerdate without counting hours and minutes
|
// 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 (
|
if (
|
||||||
sonarrFiltered.length === 0 &&
|
sonarrFiltered.length === 0 &&
|
||||||
|
|||||||
Reference in New Issue
Block a user