New: Added Running Years into the shows details

This commit is contained in:
Robin Dadswell 2021-05-25 20:03:01 +01:00 committed by Mark McDowall
parent c30ce3580a
commit 98e5442f24
3 changed files with 19 additions and 1 deletions

View File

@ -2,3 +2,7 @@
margin-right: 5px; margin-right: 5px;
color: $themeRed; color: $themeRed;
} }
.rating {
margin-right: 15px;
}

View File

@ -6,7 +6,7 @@ import styles from './HeartRating.css';
function HeartRating({ rating, iconSize }) { function HeartRating({ rating, iconSize }) {
return ( return (
<span> <span className={styles.rating}>
<Icon <Icon
className={styles.heart} className={styles.heart}
name={icons.HEART} name={icons.HEART}

View File

@ -57,6 +57,11 @@ function getExpandedState(newState) {
}; };
} }
function getDateYear(date) {
const dateDate = new Date(date);
return dateDate.getFullYear();
}
class SeriesDetails extends Component { class SeriesDetails extends Component {
// //
@ -192,6 +197,8 @@ class SeriesDetails extends Component {
seasons, seasons,
alternateTitles, alternateTitles,
tags, tags,
year,
previousAiring,
isSaving, isSaving,
isRefreshing, isRefreshing,
isSearching, isSearching,
@ -229,6 +236,7 @@ class SeriesDetails extends Component {
} = this.state; } = this.state;
const statusDetails = getSeriesStatusDetails(status); const statusDetails = getSeriesStatusDetails(status);
const runningYears = statusDetails.title === 'Ended' ? `${year}-${getDateYear(previousAiring)}` : `${year}-`;
let episodeFilesCountMessage = 'No episode files'; let episodeFilesCountMessage = 'No episode files';
@ -414,6 +422,10 @@ class SeriesDetails extends Component {
rating={ratings.value} rating={ratings.value}
iconSize={20} iconSize={20}
/> />
<span>
{runningYears}
</span>
</div> </div>
</div> </div>
@ -706,6 +718,8 @@ SeriesDetails.propTypes = {
seasons: PropTypes.arrayOf(PropTypes.object).isRequired, seasons: PropTypes.arrayOf(PropTypes.object).isRequired,
alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired, alternateTitles: PropTypes.arrayOf(PropTypes.object).isRequired,
tags: PropTypes.arrayOf(PropTypes.number).isRequired, tags: PropTypes.arrayOf(PropTypes.number).isRequired,
year: PropTypes.number.isRequired,
previousAiring: PropTypes.string,
isSaving: PropTypes.bool.isRequired, isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object, saveError: PropTypes.object,
isRefreshing: PropTypes.bool.isRequired, isRefreshing: PropTypes.bool.isRequired,