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

View File

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