eouia / MMM-CalendarExt

Calendar views for MagicMirror
MIT License
55 stars 18 forks source link

Can't have two calendar modules at the same time? #12

Closed SebastianFalborg closed 6 years ago

SebastianFalborg commented 6 years ago

I wanted to use two of this module at the same time, but if I try (and I have checked that I have them at different positions), then they don't load at all. They both show separately.

eouia commented 6 years ago

Two instances are not allowed. Why do you need that? (What is your real intention?) If I know the reason, I can suggest better answer or suggestions.

eouia commented 6 years ago

What you mean is just displaying several calendars at sme time, just add calendars in calendars. See https://github.com/eouia/MMM-CalendarExt/wiki/Configuration#calendars

SebastianFalborg commented 6 years ago

I wanted something like this. With two calendars separate with its own daily view. I wanted it to be like a school schedule (Monday to friday) with the whole school schedule displayed for that week. This is what I am trying to do.

magicmirror

If it isn't possible I'll try myself :)

eouia commented 6 years ago

@iSoap Ok. Now I understand your intention. Unfortunately, MagicMirror doesn't allow to run multi node_helper of a module. Every instance of the specific module SHOULD SHARE the same node_helper. Frankly, that's the reason why I build this module. But I've never imagined who needs multi-daily views. :)

Now, we can consider some options. 1) Just combine two calendars. - But you seem not to want this. 2) Using profiles. You can show events by profile. It means you can switch 2 calendars in a same daily view, but not simultaneously. 3) Fork this source and modify your own. If you need 2 daily views at the same time, I think some modification is needed. I believe it's not so difficult to add additional daily view. The only problem is... that's not a universal purpose. So I have some hesitation for doing that by myself.

eouia commented 6 years ago

Ah, the easist way could be to rename module.

SebastianFalborg commented 6 years ago

I have tried to make a new folder called MMM-CalendarExt2 with the other module. Do I need to rename anything in the new folder?

eouia commented 6 years ago

Rename MMM-CalendarExt.js and in MMM-CalendarExt.js,

Module.register("MMM-CalendarExt", { 

Modify this. I think that is enough.

Additionally, CSS could be confused. remove CSS contents and leave blank (in .css) of the renamed module.

eouia commented 6 years ago

Sorry for saying this. I tried to rename module, but it is more complex than I've thought. It's not easy to run 2 modules together.

SebastianFalborg commented 6 years ago

I have made a new folder called MMM-CalendarExt2 put a copy into it, I have renamed the file to MMM-CalendarExt2.js and renamed it MMM-CalendarExt2 in the Module.register. Despite having two separate in config.js with one being MMM-CalendarExt and one called MMM-CalendarExt2. They can still only show one or the other. Btw. Thank you for your responses. If I remove the "custom.css" in the renamed module. It doesn't format at all, so I think it is reading its own .css.

SebastianFalborg commented 6 years ago

Oh sorry. I didn't see you wrote. Had forgotten to refresh the page. I might just add them in the same calendar. It's just a little confusing. Thanks for all your replies. :)

SebastianFalborg commented 6 years ago

If I add two calendars in one. Can I make sure (if they start at the same time like 9:45), that one always is shown first?

eouia commented 6 years ago

@iSoap I'd considered those kinds of sorting order ago. but currently not supported.

The current sorting order is; 1) FulldayEvents 2) Start Time

I think you can modify that here https://github.com/eouia/MMM-CalendarExt/blob/master/Render.js#L585

eouia commented 6 years ago

@iSoap I added the another sorting filter by name. Now your calendar a will be upper than calendar b when the start time is same.

eouia commented 6 years ago

I'll close this issue.