mmo-calendar
1 symbol · generated 30 Sep 2026
mmo-calendar
mmo-calendar.jhs:1- Extends
- CustomAPIElement
Index
| datetime | the date the calendar is centred on: a date, or now | |
| zoom | what one screen shows: year, month, week, day or list | |
| url | where to read the events from (MMO.elements.CustomAPIElement) | |
| ViewDefault static readonly accessor | ||
| zoom accessor | What one screen shows: year, month, week, day or list. | |
| datetime accessor | Get the datetime of the calendar | |
| firstDayOfWeek accessor | The day a week starts on, 0 for Sunday. | |
| firstHourOfDay accessor | The hour the day grid scrolls to when it opens. | |
| startOfDay accessor | The first hour the day and week grids draw. | |
| endOfDay accessor | The last hour the day and week grids draw. | |
| defaultDotColor accessor | The colour of an event that carries none. | |
| init() | ||
| today() | Bring the calendar back to today, keeping the current zoom. | |
| step(dir, zoom) | Move one screen forward or back — a week, a month, a year, whatever the zoom is. | |
| update() | Redraw the grid for the current date, zoom and events. | |
| loopEvents(start, end) generator | ||
| loopHints(start, end) generator | ||
| getDayColor(date) | The background a day carries, from the hint events covering it. | |
| renderYear() | Draw the year: twelve month grids, each one a clickable month. | |
| renderMonth() | Draw the month: a week per row, with the events of each day inside its cell. | |
| setCellPosition(cell, event, gridStart, gridEnd, matrix) | Put one event on the grid: which rows it spans, and which column it takes when it overlaps another. | |
| setCellDimension(matrix) | Share the width of a column between the events that overlap in it. | |
| renderEventsWithTime(grid, startDate, endDate) | Place the events of a day or week grid on the hour rows they cover, side by side when they overlap. | |
| renderWeek() | Draw the week: seven columns of hours, with the current time marked across them. | |
| renderDay() | Draw one day: a single column of hours. | |
| renderList() | Draw the month as a list: one row per day that has something in it. | |
| (default) | anything to show above the grid, next to the toolbar |
Attributes3
datetime
mmo-calendar.jhsthe date the calendar is centred on: a date, or now
datetime="now"
zoom
mmo-calendar.jhswhat one screen shows: year, month, week, day or list
zoom="week"
url
mmo-calendar.jhswhere to read the events from (MMO.elements.CustomAPIElement)
url
Properties8
ViewDefault
staticreadonlyaccessormmo-calendar.jhs:45zoom
accessormmo-calendar.jhs:73What one screen shows: year, month, week, day or list.
- Type
string
datetime
accessormmo-calendar.jhs:92Get the datetime of the calendar
- Type
- MMO.core.Date
firstDayOfWeek
accessormmo-calendar.jhs:108The day a week starts on, 0 for Sunday.
- Type
number
firstHourOfDay
accessormmo-calendar.jhs:122The hour the day grid scrolls to when it opens.
- Type
number
startOfDay
accessormmo-calendar.jhs:136The first hour the day and week grids draw.
- Type
number
endOfDay
accessormmo-calendar.jhs:150The last hour the day and week grids draw.
- Type
number
defaultDotColor
accessormmo-calendar.jhs:164The colour of an event that carries none.
- Type
string
Methods15
init()
mmo-calendar.jhs:56today()
mmo-calendar.jhs:180Bring the calendar back to today, keeping the current zoom.
| returns | void |
step(dir, zoom)
mmo-calendar.jhs:190Move one screen forward or back — a week, a month, a year, whatever the zoom is.
| dir | number | - 1 forward, -1 back |
| zoom = null | ?string | - step by this zoom instead of the current one |
| returns | void |
update()
mmo-calendar.jhs:200Redraw the grid for the current date, zoom and events.
| returns | void |
loopEvents(start, end)
generatormmo-calendar.jhs:219| start | ||
| end |
loopHints(start, end)
generatormmo-calendar.jhs:231| start | ||
| end |
getDayColor(date)
mmo-calendar.jhs:248The background a day carries, from the hint events covering it.
| date | Date | |
| returns | ?string |
renderYear()
mmo-calendar.jhs:264Draw the year: twelve month grids, each one a clickable month.
| returns | void |
renderMonth()
mmo-calendar.jhs:337Draw the month: a week per row, with the events of each day inside its cell.
| returns | void |
setCellPosition(cell, event, gridStart, gridEnd, matrix)
mmo-calendar.jhs:431Put one event on the grid: which rows it spans, and which column it takes when it overlaps another.
| cell | HTMLElement | |
| event | object | |
| gridStart | Date | |
| gridEnd | Date | |
| matrix = null | ?Array | - the overlap map being built |
| returns | void |
setCellDimension(matrix)
mmo-calendar.jhs:537Share the width of a column between the events that overlap in it.
| matrix | Array | - the overlap map setCellPosition built |
| returns | void |
renderEventsWithTime(grid, startDate, endDate)
mmo-calendar.jhs:670Place the events of a day or week grid on the hour rows they cover, side by side when they overlap.
| grid | HTMLElement | |
| startDate | Date | |
| endDate | Date | |
| returns | void |
renderWeek()
mmo-calendar.jhs:702Draw the week: seven columns of hours, with the current time marked across them.
| returns | void |
renderDay()
mmo-calendar.jhs:769Draw one day: a single column of hours.
| returns | void |
renderList()
mmo-calendar.jhs:825Draw the month as a list: one row per day that has something in it.
| returns | void |
Slots1
(default)
mmo-calendar.jhsanything to show above the grid, next to the toolbar
<slot>