For those who run across this and want to do it yourself:
@Sean said in MMM-CalendarExtMinimonth:
@mrdenmark
I think multi-instances are possible, but all the instances will display same result unless you modify the source of each instance.
This is correct. I’ve got it completely solved. Instructions are written for Raspberry Pi.
- Install the module once using original directions.
- Change to the modules home directory:
cd ~/MagicMirror/modules
- Copy the module from it’s install directory to a new directory, so you have multiple copies (I used MMM-CalendarExtMinimonth2):
cp -r MMM-CalendarExtMinimonth MMM-CalendarExtMinimonth2
- Change to new directory:
cd MMM-CalendarExtMinimonth2
- Rename files MMM-CalendarExtMinimonth.css and MMM-CalendarExtMinimonth.js to new directory name.
mv MMM-CalendarExtMinimonth.css MMM-CalendarExtMinimonth2.css
mv MMM-CalendarExtMinimonth.js MMM-CalendarExtMinimonth2.js
5. Modify the following lines - // and everything after it is my note:
```js
dom.id = "CXMM" // Change "CXMM" to another id, I used CXMM2
colors.id = "CXMM_COLOR_TRICK" // Change CXMM to same as dom.id
var trick = document.getElementById("CXMM_COLOR_TRICK") // Change CXMM again
Module.register("MMM-CalendarExtMinimonth", { // Change MMM-CalendarExtMinimonth to name of directory
return ["MMM-CalendarExtMinimonth.css"] // change to name of CSS file.
- Change every instance of ‘moment()’ to ‘moment().add(1, “month”)’ in the file except for the two “Today” calls:
Example:
// Change
var startCalDate = moment().locale(locale).startOf('month').startOf('week')
var endCalDate = moment().locale(locale).endOf('month').endOf('week')
// To:
var startCalDate = moment().add(1, "month").locale(locale).startOf('month').startOf('week')
var endCalDate = moment().add(1, "month").locale(locale).endOf('month').endOf('week')
```js
// DO NOT CHANGE THESE
// var startToday (If today is the 15th, it'll mark the 15th of next month as today if it's changed)
// var endToday (If today is the 15th, it'll mark the 15th of next month as today if it's changed)
// moment. (No "()") - Other function, not using moment library
// moment(anything) - special function
-
In the renamed CSS file change all instances of CXMM to new dom.id name - If you don’t do this, you’ll get a string of numbers up the side.
-
In your config.js file - call it as a separate module:
{
module: "MMM-CalendarExtMinimonth2",
position: "bottom_right",
refreshInterval: 60*2.5*1000,
},
{
module: "MMM-CalendarExtMinimonth",
position: "bottom_right",
refreshInterval: 60*2.5*1000,
},
Make other changes to CSS as for default instructions.
Enjoy!