sdetweil / MMM-Config

testing
30 stars 3 forks source link

MMM-CalendarExt2 - Test Per Request on forum. #18

Closed BKeyport closed 10 months ago

BKeyport commented 3 years ago
      {
        module: "MMM-CalendarExt2",
        order: "*",
        config: {
          rotateInterval: 0,
          updateInterval: 60000,
          calendars: [
            {
              maxItems: 1000,
              scanInterval: 1800000,
              beforeDays: 60,
              afterDays: 365,
              maxIterations: 100,
              filter: "(event)=> {
return true
\t\t
}
",
              forceLocalTZ: false
            }
          ],
          scenes: [
            {
              uid: 0
            }
          ],
          views: [
            {
              mode: "daily",
              position: "top_left",
              positionOrder: -1,
              filter: "(event) =>  {
return true
\t\t
}
",
              sort: "(a,b) =>  {
return a.startDate - b.startDate
\t\t
}
",
              transform: "(event) =>  {
return event
\t\t
}
",
              fromNow: 0,
              slotCount: 3,
              slotMaxHeight: "150px",
              hideOverflow: true,
              maxItems: 1000,
              dateFormat: {
                sameDay: "[Today]",
                nextDay: "[Tomorrow]",
                nextWeek: "dddd",
                lastDay: "[Yesterday]",
                lastWeek: "[Last] ddd",
                sameElse: "M/D"
              },
              dateTimeFormat: {
                sameDay: "[Today] HH:mm",
                nextDay: "[Tomorrow] HH:mm",
                nextWeek: "dddd HH:mm",
                lastDay: "[Yesterday] HH:mm",
                lastWeek: "[Last] ddd HH:mm",
                sameElse: "M/D HH:mm"
              },
              timeFormat: {
                sameDay: "HH:mm",
                nextDay: "HH:mm",
                nextWeek: "HH:mm",
                lastDay: "HH:mm",
                lastWeek: "HH:mm",
                sameElse: "HH:mm"
              },
              relativeFormat: {
                passed: "ended %ENDFROMNOW%",
                current: "ends %ENDFROMNOW%",
                future: "starts %STARTFROMNOW% (%DURATION%)"
              },
              filterPassedEvent: false,
              useEventTimeRelative: false
            }
          ],
          iconify: "//code.iconify.design/1/1.0.0-rc3/iconify.min.js",
          firstDrawingDelay: 1000,
          config: {
            defaultSet: {
              view: {},
              calendar: {},
              scene: {}
            }
          },
          deduplicateEventsOn: []
        },
        disabled: false
      },
sdetweil commented 3 years ago

give it a try again when u can.. git pull

did u look at the form layout for calext2?

BKeyport commented 3 years ago

There's an item called "deduplicateEventsOn" that's there - I don't know what it's supposed to be. It's just above defaultSet.

I copied and pasted my production CX2 config into the testbox, and there's some oddities.

Under Views, The formatters I'm not sure what you're doing. I set one timeFormat for everything, and it does not show in your lists.

Under Calendars, the URL is missing on every calendar.

        {
            module: "MMM-CalendarExt2",
            config: {
                calendars : [
                    {
                        url: "URL",
                        name: "Main Calendar", // Optional, Recommended
                        maxItems: 20,
                        scanInterval: 1000*60*1, // every minute, Appt Book, needs this speed
                        beforeDays: 0,
                        afterDays: 30,
                        maxIterations: 999,
                        forceLocalTZ: false,
                    },
                    {
                        url: "URL",
                        name: "Seahawks Calendar",
                        maxItems: 20,
                        scanInterval: 1000*60*1,
                        beforeDays: 0,
                        afterDays: 30,
                        maxIterations: 999,
                        forceLocalTZ: false,
                    },
                    {
                        url: "URL",
                        name: "Sounders Calendar",
                        maxItems: 20,
                        scanInterval: 1000*60*1,
                        beforeDays: 0,
                        afterDays: 30,
                        maxIterations: 999,
                        forceLocalTZ: false,
                    },
                    {
                        url: "URL",
                        name: "Utility Schedule",
                        maxItems: 20,
                        scanInterval: 60*1000*1,
                        beforeDays: 0,
                        afterDays: 30,
                        maxIterations: 999,
                        forceLocalTZ: false,
                    },
                    {
                        url: "URL",
                        name: "Mariners Calendar",
                        maxItems: 20,
                        scanInterval: 60*1000*1,
                        beforeDays: 0,
                        afterDays: 30,
                        maxIterations: 999,
                        forceLocalTZ: false,
                    },
                ],
                views: [
                    {
                        mode: "daily",
                        position: "top_right",
                        slotCount: 14,
                        timeFormat:"LT",
                        hideOverflow: false,
                        filterPassedEvent: true,
                        name: "Schedules",
                        className: "remove_empty_slot",
                        calendars: ["Main Calendar","Utility Schedule","Sounders Calendar","Seahawks Calendar","Mariners Calendar"],
                        transform: function(event) {
                        if (event.title.search("Recycle") > -1) {
                                event.icon = "mdi:recycle";
                                event.className = "lemay";
                            }
                            if (event.title.search("Yard Waste") > -1) {
                                event.icon = "entypo-leaf";
                                event.className = "lemay";
                            }
                            if (event.title.search("Trash") > -1) {
                                event.icon = "bi:trash";
                                event.className = "lemay";
                            }
                            if (event.title.search("Seahawks") > -1) {
                                event.icon = "fa-solid:football-ball";
                                event.className = "seahawks";
                            }
                            if (event.title.search("Sounders") > -1) {
                                event.icon = "noto:soccer-ball";
                                event.className = "sounders";
                            }
                            if (event.title.search("Mariners") > -1) {
                                event.title = event.title.replace("⚾","");
                                event.icon = "noto:baseball";
                                event.className = "mariners";
                            }
                            return event;
                        },
                    },
                ],
                scenes: [
                    {
                        name: "DEFAULT",
                    },
                ],
            },
        },
sdetweil commented 3 years ago

I copied the calendar definition in MMM-CalendarExt2.js into the array for calendars, same for scenes and views. I didn't add or remove fields. I added some customizations, like making view mode a drop down list. see the schemas folder.

for missing fields, i would edit the module file and add then run create_schema.sh, then customize.

as for the extra fields. again I just copied what is in the code. i don't know what it does either

sdetweil commented 3 years ago

as for

Under Views, The formatters I'm not sure what you're doing. I set one timeFormat for everything, and it does not show in your lists.

in the defaultSet, views, you would have a "timeFormat":"?????? whatever the format" so, put timeFormat in the left field and the format in the right field

BKeyport commented 3 years ago

image (dateFormat, dateTimeFormat, relativeFormat as well)

is what I'm talking about - Per it's instructions, I set up one timeFormat, timeFormat:"LT", Which doesn't show at all.

At this point, I'm personally considering this one incompatible. Seems Sean left it in a bit of a mess. as I'm finding with the other module of his I've taken over as I use them personally.

sdetweil commented 3 years ago

according to the doc, u set the single value in the DEFAULSET

defaultSet: {
  view: {
    slotCount: 4,
    dateFormat: "MM/DD",
  }
},

SO, you should look there, it will override the individual settings

sdetweil commented 3 years ago

aha, another undoumented parm, next section says

will be same with   
views: [
  {
    ...
    slotCount: 4,
    dateFormat: "MM/DD",
  },
  {
    ...
    slotCount:4,
    dateFormat: "MM/DD",
  }
],
sdetweil commented 3 years ago

not even in the view structure....

sdetweil commented 3 years ago

so, use the defaultset...

BKeyport commented 3 years ago

I'm thinking the whole thing is just a mess - Sean/eouia left a mess, and with nobody maintaining it, it's a "Manual install" and hopefully something better comes along. I'm not gonna worry about CX2 anymore, and you shouldn't either. Let's concentrate on modules people are willing to work on.

sdetweil commented 3 years ago

well, I will continue to work on Ext2.. cause people use it, and I don't want THAT to be the reason people don't try my module..

already got a rejection from one of my original testers cause the form ain't perfect.. for the few modules he uses.. and he's unwilling to test my fixes...

sdetweil commented 3 years ago

I agree he left a mess.. most of his modules are alomst impossible to maintain..

BKeyport commented 3 years ago

In my spare time, I'm gonna go through the module for a full set of known commands and list them out.

sdetweil commented 1 year ago

any reason to leave this open?

sdetweil commented 1 year ago

dup of #17