@@ -759,7 +759,10 @@ class AtomicCalendarRevive extends LitElement {
759759 // generate Calendar description
760760 getCalDescHTML ( event ) {
761761 if ( event . description ) {
762- let desc = this . _config . descLength ? event . description . slice ( 0 , this . _config . descLength ) : event . description
762+ var desc = event . description
763+ if ( this . _config . descLength && event . description . length > this . _config . descLength ) {
764+ var desc = event . description . slice ( 0 , this . _config . descLength )
765+ }
763766 return html `< div class ="calDescription "> - ${ desc } </ div > ` ;
764767 }
765768 }
@@ -969,40 +972,46 @@ class AtomicCalendarRevive extends LitElement {
969972 : '' ;
970973
971974 // Show the description
972- const descHTML = this . _config . showDescription ? this . _config . descLength ? html `< div class ="event-description "> ${ event . description . slice ( 0 , this . _config . descLength ) } </ div > ` : event . description : '' ;
975+ const descHTML = this . _config . showDescription ?
976+ event . description && this . _config . descLength && event . description . length >= this . _config . descLength ?
977+ html `< div class ="event-description "> ${ event . description . slice ( 0 , this . _config . descLength ) } </ div > `
978+ : html `< div class ="event-description "> ${ event . description } </ div > `
979+ : '' ;
973980
974981 const lastEventStyle = i == arr . length - 1 ? 'padding-bottom: 8px;' : '' ;
975982 // check and set the date format
976983 const eventDateFormat =
977984 this . _config . europeanDate == true
978- ? html `${ i === 0 ? event . startTimeToShow . format ( 'DD' ) + ' ' : '' } ${ i === 0 && this . _config . showMonth
979- ? event . startTimeToShow . format ( 'MMM' )
980- : '' } `
985+ ? html `${ i === 0 ? event . startTimeToShow . format ( 'DD' ) + ' ' : ''
986+ } ${ i === 0 && this . _config . showMonth
987+ ? event . startTimeToShow . format ( 'MMM' )
988+ : '' } `
981989 : html `${ i === 0 && this . _config . showMonth ? event . startTimeToShow . format ( 'MMM' ) + ' ' : '' } ${ i === 0
982990 ? event . startTimeToShow . format ( 'DD' )
983- : '' } `;
991+ : ''
992+ } `;
984993
985994 const dayClassTodayEvent = event . startTime . isSame ( dayjs ( ) , 'day' ) ? `event-leftCurrentDay` : `` ;
986995
987996 return html `< tr class ="${ dayWrap } " style ="color: ${ this . _config . dayWrapperLineColor } ; ">
988- < td class ="event-left " style ="color: ${ this . _config . dateColor } ;font-size: ${ this . _config . dateSize } %; ">
989- < div class =${ dayClassTodayEvent } >
990- ${ i === 0 && this . _config . showWeekDay ? event . startTimeToShow . format ( 'ddd' ) : '' }
991- </ div >
992- < div class =${ dayClassTodayEvent } > ${ eventDateFormat } </ div >
993- </ td >
994- < td style ="width: 100%; ${ finishedEventsStyle } ${ lastEventStyle } ">
995- < div > ${ currentEventLine } </ div >
996- < div class ="event-right ">
997- < div class ="event-main "> ${ this . getTitleHTML ( event ) } ${ hoursHTML } ${ relativeTime } </ div >
998- < div class ="event-location "> ${ this . getLocationHTML ( event ) } ${ eventCalName } </ div >
999- </ div >
1000- < div class ="event-right ">
1001- < div class ="event-main "> ${ descHTML } </ div >
1002- </ div >
997+ < td class ="event-left " style ="color: ${ this . _config . dateColor } ;font-size: ${ this . _config . dateSize } %; ">
998+ < div class =${ dayClassTodayEvent } >
999+ ${ i === 0 && this . _config . showWeekDay ? event . startTimeToShow . format ( 'ddd' ) : '' }
1000+ </ div >
1001+ < div class =${ dayClassTodayEvent } > ${ eventDateFormat } </ div >
1002+ </ td >
1003+ < td style ="width: 100%; ${ finishedEventsStyle } ${ lastEventStyle } ">
1004+ < div > ${ currentEventLine } </ div >
1005+ < div class ="event-right ">
1006+ < div class ="event-main "> ${ this . getTitleHTML ( event ) } ${ hoursHTML } ${ relativeTime } </ div >
1007+ < div class ="event-location "> ${ this . getLocationHTML ( event ) } ${ eventCalName } </ div >
1008+ </ div >
1009+ < div class ="event-right ">
1010+ < div class ="event-main "> ${ descHTML } </ div >
1011+ </ div >
10031012 ${ progressBar }
1004- </ td >
1005- </ tr > ` ;
1013+ </ td >
1014+ </ tr > ` ;
10061015 } ) ;
10071016
10081017 return htmlEvents ;
0 commit comments