mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Update calendar.js
Small updates for travis cr check
This commit is contained in:
parent
a70716f225
commit
2b2e8508d9
@ -456,13 +456,13 @@ Module.register("calendar", {
|
|||||||
if (this.config.sliceMultiDayEvents) {
|
if (this.config.sliceMultiDayEvents) {
|
||||||
var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); //next midnight
|
var midnight = moment(event.startDate, "x").clone().startOf("day").add(1, "day").format("x"); //next midnight
|
||||||
var count = 1;
|
var count = 1;
|
||||||
var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf('day').format("x"))/(1000*60*60*24)) + 1
|
var maxCount = Math.ceil(((event.endDate - 1) - moment(event.startDate, "x").endOf("day").format("x"))/(1000*60*60*24)) + 1
|
||||||
if (event.endDate > midnight) {
|
if (event.endDate > midnight) {
|
||||||
while (event.endDate > midnight) {
|
while (event.endDate > midnight) {
|
||||||
var nextEvent = JSON.parse(JSON.stringify(event)); //make a copy without reference to the original event
|
var nextEvent = JSON.parse(JSON.stringify(event)); //make a copy without reference to the original event
|
||||||
nextEvent.startDate = midnight;
|
nextEvent.startDate = midnight;
|
||||||
event.endDate = midnight;
|
event.endDate = midnight;
|
||||||
event.title += " ("+count+"/"+maxCount+")";
|
event.title += " (" + count + "/" + maxCount + ")";
|
||||||
events.push(event);
|
events.push(event);
|
||||||
event = nextEvent;
|
event = nextEvent;
|
||||||
count += 1;
|
count += 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user