-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 show ends only with duration #2968
base: develop
Are you sure you want to change the base?
Calendar show ends only with duration #2968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the PR, but needs a little work.
@@ -18,6 +18,6 @@ | |||
|
|||
.calendar .time { | |||
padding-left: 30px; | |||
text-align: right; | |||
text-align: left; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will break layout of old configs, please dont
@@ -317,7 +318,11 @@ Module.register("calendar", { | |||
|
|||
// Add endDate to dataheaders if showEnd is enabled | |||
if (this.config.showEnd) { | |||
timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT"); | |||
if(this.config.showEndsOnlyWithDuration && event.startDate == event.endDate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "===" for comparison
@@ -336,8 +341,12 @@ Module.register("calendar", { | |||
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat)); | |||
// Add end time if showEnd | |||
if (this.config.showEnd) { | |||
timeWrapper.innerHTML += "-"; | |||
timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat)); | |||
if(this.config.showEndsOnlyWithDuration && event.startDate == event.endDate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "===" for comparison
@@ -417,7 +417,8 @@ const CalendarUtils = { | |||
|
|||
endDate = moment(parseInt(startDate.format("x")) + duration, "x"); | |||
if (startDate.format("x") === endDate.format("x")) { | |||
endDate = endDate.endOf("day"); | |||
// see https://forum.magicmirror.builders/topic/17380/calendar-event-same-start-and-enddate-wrong-google-calendar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe in the comment why this gets removed, the link to the forum could one day be gone :-) And maybe remove the whole if-block since it isnt used anymore?
@kleinmantara can you make the requested changes? Otherwise we will close this PR. |
@rejas can you push it in another (temp) branch ? Author seams not respond I will see what can i do with this for v2.26 |
you can do |
sure but not in my fork ;) I have found it's ok :) |
I added a showEndsOnlyWithDuration calendar option to show only end times with a duration.
More details: https://forum.magicmirror.builders/topic/17380/calendar-event-same-start-and-enddate-wrong-google-calendar