MagicMirrorOrg / MagicMirror

MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant.
http://magicmirror.builders
MIT License
19.76k stars 4.2k forks source link

Calendar event across days with time, shows end date/time, even if showsEndOnlyWithDuration:false (default) #3598

Open sdetweil opened 4 days ago

sdetweil commented 4 days ago

using 2.29 test ics

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20241026T010000Z
DTEND:20241026T230000Z
DTSTAMP:20241024T153358Z
UID:4maud6s79m41a99pj2g7j5km0a@google.com
CREATED:20241024T153313Z
LAST-MODIFIED:20241024T153330Z
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Sleep over at Bobs
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

shows end date/time, regardless of showsEndOnlyWithDuration setting

sdetweil commented 4 days ago

existiing code in calendar.js tests 2 things at the same time

if(showsEndOnlyWithDuration === true AND startdate===endate){
    do nothing
} else{
   add end display on
}

should be

if( startdate !== endate ){
  if( showsEndOnlyWithDuration === true ){
   add end display on
  }
}

will fix and testcase for both conditions

sdetweil commented 4 days ago

SO.. fixing this causes a breaking change, as the setting was effectively ignored before, no testcase to test it

currently default is false.

fixing code breaks a few testcases.. generally shouldn't change testcases.. thats why they are there

change the default to true (same effective behavior as before fix) allows old testcases to continue

this exposes another issue.. we can't allow new config parms without at least 2 testcases.. with and without.. I don't know how we can enforce that in build

currently waiting

sdetweil commented 3 days ago

I think we live with the breaking change.. default is false.. I fixed the testcases...