1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01: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 (showReleaseDate) {
if (physicalRelease && digitalRelease) { if (physicalRelease && digitalRelease) {
if (physicalRelease < digitalRelease) { if (physicalRelease < digitalRelease) {
releaseDate = getRelativeDate( releaseDate = physicalRelease;
physicalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else { } else {
getRelativeDate( releaseDate = digitalRelease;
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} }
} else if (physicalRelease && !digitalRelease) { } else if (physicalRelease && !digitalRelease) {
releaseDate = getRelativeDate( releaseDate = physicalRelease;
physicalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else if (digitalRelease && !physicalRelease) { } else if (digitalRelease && !physicalRelease) {
releaseDate = getRelativeDate( releaseDate = digitalRelease;
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else { } else {
releaseDate = getRelativeDate( releaseDate = inCinemas;
inCinemas,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} }
} }
@ -318,7 +278,15 @@ class MovieIndexPoster extends Component {
{ {
showReleaseDate && showReleaseDate &&
<div className={styles.title}> <div className={styles.title}>
{releaseDate} {getRelativeDate(
releaseDate,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
)}
</div> </div>
} }

View File

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