MagicMirror icon indicating copy to clipboard operation
MagicMirror copied to clipboard

Calendar Enhancement - End Date for dateheaders Time Format

Open doubled136 opened this issue 5 years ago • 6 comments

Not really sure how to pull or merge for a feature enhancement. In the Calendar module, I noticed that when "dateheaders" is selected, "showEnd" doesn't do anything but it would be reasonable to allow the option to show an end time, especially since showEnd is false by default.

From line 273 in calendar.js, I added an if statement to check for showEnd and publish the end time of an event: timeWrapper.innerHTML = moment(event.startDate, "x").format("LT"); //Add for End Date from showEnd for dataheaders if (this.config.showEnd) { timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT"); }

Not sure if this is helpful but I figured I would put it out there.

doubled136 avatar Nov 10 '20 19:11 doubled136

Could you please send a PR (if its not already fixed in the develop branch). Thanks!

MichMich avatar Dec 08 '20 14:12 MichMich

I am happy to collaborate on this fix 👍

@doubled136, could you describe a bit how to reproduce the issue?

sbehrends avatar Jan 08 '21 02:01 sbehrends

@sbehrends I was able to reproduce this issue. I have the following set in my config.js for the default calendar module:

timeFormat: "dateheaders",
showEnd: true,

But the calendar on my MagicMirror only shows the start time of events and not the end time. I can confirm that adding @doubled136's code works (although for me it was line 312 in calendar.js, not line 273).

wrongwaymarv avatar Jan 28 '21 14:01 wrongwaymarv

Not really sure how to pull or merge for a feature enhancement. In the Calendar module, I noticed that when "dateheaders" is selected, "showEnd" doesn't do anything but it would be reasonable to allow the option to show an end time, especially since showEnd is false by default.

From line 273 in calendar.js, I added an if statement to check for showEnd and publish the end time of an event: timeWrapper.innerHTML = moment(event.startDate, "x").format("LT"); //Add for End Date from showEnd for dataheaders if (this.config.showEnd) { timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT"); }

Not sure if this is helpful but I figured I would put it out there.

This fix works for me too.

LilSlippinJimmy avatar May 07 '22 14:05 LilSlippinJimmy

I might take a stab at this and provide a PR, could you assign this issue to me @MichMich ?

rejas avatar May 08 '22 17:05 rejas

Created a PR for @doubled136 fix, maybe you can check it out?

rejas avatar May 10 '22 19:05 rejas

seems to be fixed with the above PR, so should be closed @doubled136 @MichMich

khassel avatar Oct 03 '22 08:10 khassel