Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar Enhancement - End Date for dateheaders Time Format #2192

Closed
doubled136 opened this issue Nov 10, 2020 · 7 comments
Closed

Calendar Enhancement - End Date for dateheaders Time Format #2192

doubled136 opened this issue Nov 10, 2020 · 7 comments
Assignees

Comments

@doubled136
Copy link

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.

@MichMich
Copy link
Collaborator

MichMich commented Dec 8, 2020

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

@sbehrends
Copy link

I am happy to collaborate on this fix 👍

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

@wrongwaymarv
Copy link

wrongwaymarv commented Jan 28, 2021

@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).

@LilSlippinJimmy
Copy link

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.

@rejas
Copy link
Collaborator

rejas commented May 8, 2022

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

@rejas
Copy link
Collaborator

rejas commented May 10, 2022

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

@khassel
Copy link
Collaborator

khassel commented Oct 3, 2022

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

@MichMich MichMich closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants