1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-08-18 00:09:37 +02:00

tidied up to only have getRelativeDate once per item

This commit is contained in:
Robin Dadswell 2021-01-06 00:45:16 +00:00 committed by Qstick
parent 9e7ea6f55b
commit 913766f9af
2 changed files with 15 additions and 46 deletions

View File

@ -136,56 +136,16 @@ class MovieIndexPoster extends Component {
if (showReleaseDate) {
if (physicalRelease && digitalRelease) {
if (physicalRelease < digitalRelease) {
releaseDate = getRelativeDate(
physicalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
releaseDate = physicalRelease;
} else {
getRelativeDate(
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
releaseDate = digitalRelease;
}
} else if (physicalRelease && !digitalRelease) {
releaseDate = getRelativeDate(
physicalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
releaseDate = physicalRelease;
} else if (digitalRelease && !physicalRelease) {
releaseDate = getRelativeDate(
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
releaseDate = digitalRelease;
} else {
releaseDate = getRelativeDate(
inCinemas,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
releaseDate = inCinemas;
}
}
@ -318,7 +278,15 @@ class MovieIndexPoster extends Component {
{
showReleaseDate &&
<div className={styles.title}>
{releaseDate}
{getRelativeDate(
releaseDate,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
)}
</div>
}

View File

@ -871,6 +871,7 @@
"ShowQualityProfile": "Show Quality Profile",
"ShowQualityProfileHelpText": "Show quality profile under poster",
"ShowRatings": "Show Ratings",
"ShowReleaseDateHelpText": "Show release date under poster",
"ShowSearch": "Show Search",
"ShowSearchHelpText": "Show search button on hover",
"ShowSizeOnDisk": "Show Size on Disk",