diff --git a/frontend/src/Calendar/Agenda/AgendaEvent.css b/frontend/src/Calendar/Agenda/AgendaEvent.css index 2b39f677b..af2cbde38 100644 --- a/frontend/src/Calendar/Agenda/AgendaEvent.css +++ b/frontend/src/Calendar/Agenda/AgendaEvent.css @@ -90,3 +90,8 @@ flex: 0 0 100%; } } + +.dateIcon { + display: inline; + margin-right: 10px; +} diff --git a/frontend/src/Calendar/Agenda/AgendaEvent.js b/frontend/src/Calendar/Agenda/AgendaEvent.js index f0216c9a4..e7115dee7 100644 --- a/frontend/src/Calendar/Agenda/AgendaEvent.js +++ b/frontend/src/Calendar/Agenda/AgendaEvent.js @@ -44,6 +44,8 @@ class AgendaEvent extends Component { genres, isAvailable, inCinemas, + digitalRelease, + physicalRelease, monitored, hasFile, grabbed, @@ -52,10 +54,29 @@ class AgendaEvent extends Component { showMovieInformation, showCutoffUnmetIcon, longDateFormat, - colorImpairedMode + colorImpairedMode, + startDate, + endDate } = this.props; - const startTime = moment(inCinemas); + const agendaStart = Date.parse(startDate); + const agendaEnd = Date.parse(endDate); + const cinemaDate = Date.parse(inCinemas); + const digitalDate = Date.parse(digitalRelease); + let startTime = physicalRelease; + let releaseIcon = icons.DISC; + + if (digitalDate >= agendaStart && digitalDate <= agendaEnd) { + startTime = digitalRelease; + releaseIcon = icons.MOVIE_FILE; + } + + if (cinemaDate >= agendaStart && cinemaDate <= agendaEnd) { + startTime = inCinemas; + releaseIcon = icons.IN_CINEMAS; + } + + startTime = moment(startTime); const downloading = !!(queueItem || grabbed); const isMonitored = monitored; const statusStyle = getStatusStyle(hasFile, downloading, isAvailable, isMonitored); @@ -71,12 +92,18 @@ class AgendaEvent extends Component { )} to={link} > -
- { - showDate && - startTime.format(longDateFormat) - } -
+ { + showDate && +
+
+ +
+ {startTime.format(longDateFormat)} +
+ }
{ + (state) => state.calendar.start, + (state) => state.calendar.end, + (calendarOptions, movie, movieFile, queueItem, uiSettings, startDate, endDate) => { return { movie, movieFile, @@ -21,7 +23,9 @@ function createMapStateToProps() { ...calendarOptions, timeFormat: uiSettings.timeFormat, longDateFormat: uiSettings.longDateFormat, - colorImpairedMode: uiSettings.enableColorImpairedMode + colorImpairedMode: uiSettings.enableColorImpairedMode, + startDate, + endDate }; } );