From 6d87b5dfece082f46468b3b438b9d4db3f4efb24 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 7 Dec 2019 02:11:29 -0500 Subject: [PATCH] Fixed: Show Physical Releases on Calendar --- frontend/src/Calendar/Day/CalendarDay.js | 1 + .../src/Calendar/Day/CalendarDayConnector.js | 2 +- frontend/src/Calendar/Events/CalendarEvent.js | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/src/Calendar/Day/CalendarDay.js b/frontend/src/Calendar/Day/CalendarDay.js index 91f473779..a714f94d4 100644 --- a/frontend/src/Calendar/Day/CalendarDay.js +++ b/frontend/src/Calendar/Day/CalendarDay.js @@ -40,6 +40,7 @@ function CalendarDay(props) { diff --git a/frontend/src/Calendar/Day/CalendarDayConnector.js b/frontend/src/Calendar/Day/CalendarDayConnector.js index 01838f644..86a37ac54 100644 --- a/frontend/src/Calendar/Day/CalendarDayConnector.js +++ b/frontend/src/Calendar/Day/CalendarDayConnector.js @@ -22,7 +22,7 @@ function createCalendarEventsConnector() { (state) => state.calendar.items, (date, items) => { const filtered = _.filter(items, (item) => { - return moment(date).isSame(moment(item.inCinemas), 'day'); + return moment(date).isSame(moment(item.inCinemas), 'day') || moment(date).isSame(moment(item.physicalRelease), 'day'); }); return sort(filtered); diff --git a/frontend/src/Calendar/Events/CalendarEvent.js b/frontend/src/Calendar/Events/CalendarEvent.js index bb0b32671..e6de190b7 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.js +++ b/frontend/src/Calendar/Events/CalendarEvent.js @@ -38,7 +38,8 @@ class CalendarEvent extends Component { queueItem, showMovieInformation, showCutoffUnmetIcon, - colorImpairedMode + colorImpairedMode, + date } = this.props; const startTime = moment(inCinemas); @@ -47,6 +48,7 @@ class CalendarEvent extends Component { const statusStyle = getStatusStyle(hasFile, isDownloading, startTime, isMonitored); const joinedGenres = genres.slice(0, 2).join(', '); const link = `/movie/${titleSlug}`; + const eventType = moment(date).isSame(moment(inCinemas), 'day') ? 'In Cinemas' : 'Physical Release'; return (
@@ -104,6 +106,15 @@ class CalendarEvent extends Component {
} + + { + showMovieInformation && +
+
+ {eventType} +
+
+ } @@ -125,7 +136,8 @@ CalendarEvent.propTypes = { showMovieInformation: PropTypes.bool.isRequired, showCutoffUnmetIcon: PropTypes.bool.isRequired, timeFormat: PropTypes.string.isRequired, - colorImpairedMode: PropTypes.bool.isRequired + colorImpairedMode: PropTypes.bool.isRequired, + date: PropTypes.string.isRequired // onEventModalOpenToggle: PropTypes.func.isRequired };