formatted date

This commit is contained in:
Robin Dadswell 2021-01-06 00:06:14 +00:00 committed by Qstick
parent 1a755bd3c0
commit c2c4186965
2 changed files with 63 additions and 9 deletions

View File

@ -134,13 +134,57 @@ class MovieIndexPoster extends Component {
let releaseDate = ''; let releaseDate = '';
if (showReleaseDate) { if (showReleaseDate) {
if (physicalRelease && digitalRelease) { if (physicalRelease && digitalRelease) {
releaseDate = ''; if (physicalRelease < digitalRelease) {
} else if (physicalRelease && !digitalRelease) { releaseDate = getRelativeDate(
releaseDate = physicalRelease; physicalRelease,
} else if (digitalRelease && !physicalRelease) { shortDateFormat,
releaseDate = digitalRelease; showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else { } else {
releaseDate = inCinemas; getRelativeDate(
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
}
} else if (physicalRelease && !digitalRelease) {
releaseDate = getRelativeDate(
physicalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else if (digitalRelease && !physicalRelease) {
releaseDate = getRelativeDate(
digitalRelease,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} else {
releaseDate = getRelativeDate(
inCinemas,
shortDateFormat,
showRelativeDates,
{
timeFormat,
timeForToday: false
}
);
} }
} }
@ -272,9 +316,12 @@ class MovieIndexPoster extends Component {
{ {
showReleaseDate && showReleaseDate &&
<div className={styles.title}> <RelativeDateCellConnector
{releaseDate} key={releaseDate}
</div> className={styles.title}
date={releaseDate}
component={VirtualTableRowCell}
/>
} }
<MovieIndexPosterInfo <MovieIndexPosterInfo

View File

@ -38,7 +38,8 @@ function calculateRowHeight(posterHeight, sortKey, isSmallScreen, posterOptions)
detailedProgressBar, detailedProgressBar,
showTitle, showTitle,
showMonitored, showMonitored,
showQualityProfile showQualityProfile,
showReleaseDate
} = posterOptions; } = posterOptions;
const nextAiringHeight = 19; const nextAiringHeight = 19;
@ -62,6 +63,10 @@ function calculateRowHeight(posterHeight, sortKey, isSmallScreen, posterOptions)
heights.push(19); heights.push(19);
} }
if (showReleaseDate) {
heights.push(19);
}
switch (sortKey) { switch (sortKey) {
case 'studio': case 'studio':
case 'added': case 'added':
@ -206,7 +211,8 @@ class MovieIndexPosters extends Component {
detailedProgressBar, detailedProgressBar,
showTitle, showTitle,
showMonitored, showMonitored,
showQualityProfile showQualityProfile,
showReleaseDate
} = posterOptions; } = posterOptions;
const movieIdx = rowIndex * columnCount + columnIndex; const movieIdx = rowIndex * columnCount + columnIndex;
@ -235,6 +241,7 @@ class MovieIndexPosters extends Component {
showTitle={showTitle} showTitle={showTitle}
showMonitored={showMonitored} showMonitored={showMonitored}
showQualityProfile={showQualityProfile} showQualityProfile={showQualityProfile}
showReleaseDate={showReleaseDate}
showRelativeDates={showRelativeDates} showRelativeDates={showRelativeDates}
shortDateFormat={shortDateFormat} shortDateFormat={shortDateFormat}
timeFormat={timeFormat} timeFormat={timeFormat}