diff --git a/docs/Configuration.md b/docs/Configuration.md index 63f166d..7d5f57e 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -28,9 +28,9 @@ There should be AT LEAST one **scene**, one **view** and one **calendar**. **Concept** ![Concept](scene-view-calendar.png) ![What is a scene, what is a view](scene-view.png) -- You should have at least ONE Scene for display your events. +- You should have at least ONE Scene to display your events. - Each Scene could have at least ONE View. You can assume each scene as a profile or page. -- Each View decide how to show events. It can could have at least ONE calendar or more. You can choose to show which calendar events and how to be displayed and more by configuration. +- Each View decides how to show events. It must have at least ONE calendar or more. You can choose to show which calendar events and how to be displayed and more by configuration. - A Calendar is your .ics file or URL. You can manipulate events by configuration. - To point specific Scene/View/Calendar, It could have `name`. and almost everything will be configurable. diff --git a/docs/Configuration/View.md b/docs/Configuration/View.md index 8faf1dd..e94365f 100644 --- a/docs/Configuration/View.md +++ b/docs/Configuration/View.md @@ -39,7 +39,7 @@ These fields could be used in all views. (But some fields might work differently |position |String | "bottom_bar" | "top_left" | Where to display this view. |positionOrder |Integer |2 | -1 | view order in position region. `-1`: last of region, `0`: first of region, Any positive integer like `2`: `n`th in region |calendars |Array of calendar names | ["My Football calendar", "US Holidays"] | [] | Which calendar events will be shown in this view. For all calendars, just set to `[]` -|title |String | "SCHEDULE" | "" | It will be used as module header title. +|title |String or callback | "SCHEDULE" | "" | It will be used as module header title. |locale |String | "de-DE" | default locale | You can apply specific locale to only this view instead default locale. |fromNow |Integer | -1 | 0 | When this view calendar will be start.
By example; in `view:monthly`, `-1` will be last month, `0` will be this month, `1` will be next month.

In view of `upcoming`, `current`, this value will be ignored. |slotCount |Integer |4 | 3 | How many periodic calendar slot will be shown.
By example; in `view:monthly`, `3` will show 3 `monthly` view slot.

`mode:daily`, `fromNow:-1`, `slotCount:3` will be show *3 daily calendar slots from yesterday to tomorrow* @@ -59,3 +59,14 @@ These fields could be used in all views. (But some fields might work differently |filter|Function | (e)=>{} | (e)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md) |sort|Function | (a,b)=>{} | (a,b)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md) |transform|Function| (e)=>{} | (e)=>{...} | See [Filtering and Sorting](../Filtering-and-Sorting.md) + +#### title callback +If you can set `title` as a callback function, the result of function will be used as module title. +```js +title: (mObj) => { + return mObj.format("[My Weekly:] Wo") +}, +``` +This example will return "My Weekly: 49th" or similar. + +callback function get `moment Object` of first slot start time for arguments. So you can handle it in callback function. diff --git a/docs/Configuration/Views/week,-month.md b/docs/Configuration/Views/week,-month.md index ed419d7..0beecbf 100644 --- a/docs/Configuration/Views/week,-month.md +++ b/docs/Configuration/Views/week,-month.md @@ -13,6 +13,7 @@ If you set these view positions as `fullscreen_below` or `fullscreen_above`, the |showWeekends |Boolean |false |true |Show Saturday and Sunday. |slotMaxHeight |String |"150px" |"240px" |height of calendar cell. `hideOverflow` is set to `true` by force in this view. |weeksFormat |String |"[week] wo" |"wo" |Weeks mark of calendar. +|monthFormat |String | "[Month:] MM" | "MMMM" |The title of month in current view. (CSS selector:`.monthViewTitle`) # View:month |field |value type |value example |default value |memo | diff --git a/docs/Event-Object.md b/docs/Event-Object.md index 64334fe..085037b 100644 --- a/docs/Event-Object.md +++ b/docs/Event-Object.md @@ -12,6 +12,7 @@ isFullday:false isMoment:false isOneday:true isPassed:false +isRecurring:false location:"" startDate:"1546631100" startDateJ:"2019-01-04T19:45:00.000Z" @@ -34,4 +35,4 @@ By example; calendars: ["Holiday", "Office Schedule", "Wife"], } ``` -In this example, `Holiday` will have `calendarSeq:0`, then, `Office Schdule` will have `calendarSeq:1`, ... \ No newline at end of file +In this example, `Holiday` will have `calendarSeq:0`, then, `Office Schdule` will have `calendarSeq:1`, ... diff --git a/docs/Event-Time.md b/docs/Event-Time.md index 7c0cdb4..54005ac 100644 --- a/docs/Event-Time.md +++ b/docs/Event-Time.md @@ -14,7 +14,7 @@ You can define how to show the event time. `timeFormat`, `dateFormat` and `dateT - e.g) `dateFormat:"ddd MM/DD",` will be displayed as `Mon 12/17` in `en-US` locale. - **dateTimeFormat** - This format will be used for all other event. - - e.g) `dateFormat:"HH:mm M/D",` will be displayed as `01:23 1/3`. + - e.g) `dateTimeFormat:"HH:mm M/D",` will be displayed as `01:23 1/3`. - Or You can use more complex calendar-style formatter object to define more humanized time. - e.g) for `dateTimeFormat`, below format will be displayed as `Yesterday 12:34` or `Last Sat 02:00`. diff --git a/docs/Tip:-Sync-with-MMM-Pages..md b/docs/Tip:-Sync-with-MMM-Pages..md new file mode 100644 index 0000000..b3ba718 --- /dev/null +++ b/docs/Tip:-Sync-with-MMM-Pages..md @@ -0,0 +1,119 @@ +Many people are asking me How to use this module with [MMM-Pages](https://github.com/edward-shen/MMM-pages). + + +Like this; + +PAGE1 +![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_1.png) + +PAGE2 +![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_2.png) + +PAGE3 +![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_3.png) + +Let's configure. + +**`MMM-Pages`** +```js +{ + module: 'MMM-pages', + config: { + modules: [ + ["clock", ], + ["MMM-COVID-19", ], + ["MMM-News", ], + ], + fixed: ["MMM-page-indicator", "MMM-CalendarExt2"], + rotationTime: 1000 * 5, + } +}, +``` +I've set 3 pages (page:0, page:1, page:2). Each has some other modules like `clock`. Now I'll show a different view of MMM-CalendarExt2 in each page. + +**`MMM-CalendarExt2`** +```js +{ + module: 'MMM-CalendarExt2', + position: "top_left", // meaningless. + config: { + rotateInterval: 0, + updateInterval: 1000 * 60 * 60, + calendars : [ + { + name: "bundesliga", + url: "webcal://www.google.com/calendar/ical/spielplan.1.bundesliga%40gmail.com/public/basic.ics", + icon: "emojione-flag-for-flag-germany", + }, + ], + views: [ + { + name: "VIEW1", + mode: "daily", + position:"top_right", + slotCount: 1, + calendars: ["bundesliga"], + }, + { + name: "VIEW2", + mode: "weekly", + position:"top_right", + slotCount: 1, + calendars: ["bundesliga"], + }, + { + name: "VIEW3", + mode: "monthly", + position:"top_right", + slotCount: 1, + calendars: ["bundesliga"], + }, + ], + scenes: [ + { + name: "PAGE1", + views:["VIEW1"], + }, + { + name: "PAGE2", + views:["VIEW1", "VIEW2"], + }, + { + name: "PAGE3", + views:["VIEW1", "VIEW2", "VIEW3"], + className: "fakeScene" + }, + ], + notifications: { + "PAGE_INCREMENT" : { + exec: "sceneNext", + }, + "PAGE_DECREMENT" : { + exec: "scenePrevious", + } + }, + }, +}, + +``` +I made 3 views and put them into 3 scenes. +Then, see `notifications` section. When `PAGE_INCREMENT` is coming, **`sceneNext`** command is executed. easy. +The results are above pictures. +And, this is already explained in wiki of github. + + +**One More Thing** + +_Hey, I want page 3 empty. How to remove view or scene in that page?_ + +I wrote `className:fakeScene,` in 3rd scene config. Let's add this into your `css/custom.css` +```css +.CX2.fakeScene { + display:none; +} +``` + +Now, the 3rd scene will be displayed like this. + +![](https://raw.githubusercontent.com/eouia/MMM-CalendarExt2/master/doc/Page_4.png) + diff --git a/docs/Usage.md b/docs/Usage.md index 87c7740..bcf4564 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -80,8 +80,8 @@ payload: (payload, sender) => { ``` **Available executable functions** -- `nextScene()` -- `previousScene()` +- `sceneNext()` +- `scenePrevious()` - `changeSceneById(seq)` - `chageSceneByName(name)` -- `eventQuery({filter:fn(event), callback:fn(events)})` \ No newline at end of file +- `eventQuery({filter:fn(event), callback:fn(events)})`