diff --git a/RELEASE.md b/RELEASE.md index 8ad7c3aa6..a2864c1d5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,6 +41,20 @@ - ... --> +## Versione X.X.X (dd/mm/yyyy) + +### Migliorie + +- Il sottotitolo del CT Evento mostra il range di date per tutti gli eventi con ricorrenza o con una data di fine diversa dalla data di inizio. + +### Novità + +- ... + +### Fix + +- La pagina non dà più errore quando si imposta una ricorrenza con impostazione "Termina dopo tot. ricorrenze". + ## Versione 11.25.3 (12/12/2024) ### Migliorie diff --git a/src/components/ItaliaTheme/View/Commons/Dates.jsx b/src/components/ItaliaTheme/View/Commons/Dates.jsx index fc25e542c..6ea82e5e4 100644 --- a/src/components/ItaliaTheme/View/Commons/Dates.jsx +++ b/src/components/ItaliaTheme/View/Commons/Dates.jsx @@ -85,6 +85,7 @@ const Dates = ({ content, show_image, moment: momentlib, rrule }) => { const start = viewDate(intl.locale, content.start); // format and save date into new variable depending on recurrence of event const end = viewDate(intl.locale, actualEndDate); + const openEnd = content?.open_end; const wholeDay = content?.whole_day; const rdates = rruleSet?.rdates() ?? []; @@ -133,11 +134,11 @@ const Dates = ({ content, show_image, moment: momentlib, rrule }) => {
- {!Moment(content.end).isSame(actualEndDate) && + {(content.recurrence || !renderOnlyStart) && !openEnd && - !renderOnlyStart && `dal ${Moment(content.start).format('DD-MM-Y')} al ${endDate}`} - {(renderOnlyStart || Moment(content.end).isSame(actualEndDate)) && + {!content.recurrence && + renderOnlyStart && !openEnd && `${Moment(content.start).format('DD-MM-Y')}`} {openEnd && diff --git a/src/helpers/dates.js b/src/helpers/dates.js index bf7fde920..58464e1e7 100644 --- a/src/helpers/dates.js +++ b/src/helpers/dates.js @@ -48,7 +48,8 @@ export const getRealStartAndEndWithRecurrence = ( export const getRealEventEnd = (content, rruleSet) => { let actualEndDate = content.end; - if (content.recurrence) { + + if (content.recurrence && rruleSet.rrules()[0].options.until) { actualEndDate = rruleSet.rrules()[0].options.until; } return actualEndDate;