Const
This hook is emitted any time the current date is updated. The current date can be updated by several means:
What is passed: When this hook is emitted it will pass a DateChangeResponse object.
Examples:
How to listen for the hook:
Hooks.on(SimpleCalendar.Hooks.DateTimeChange, (data) => { console.log(data); });
Response Data:
{ "date": { "year": 2021, "month": 6, "dayOffset": 0, "day": 8, "dayOfTheWeek": 5, "hour": 0, "minute": 15, "second": 30, "yearZero": 1970, "sunrise": 1622527200, "sunset": 1622570400, "midday": 1622548800, "weekdays": [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], "showWeekdayHeadings": true, "currentSeason": { "color": "#f3fff3", "startingMonth": 5, "startingDay": 19, "name": "Summer" }, "isLeapYear": false, "display": { "day": "9", "daySuffix": "th", "weekday": "Friday", "monthName": "July", "month": "7", "year": "2021", "yearName": "", "yearPrefix": "", "yearPostfix": "", "time": "00:15:30" } }, "diff": 1, "moons": [ { "name": "Moon", "color": "#ffffff", "cycleLength": 29.53059, "cycleDayAdjust": 0.5, "currentPhase": { "name": "New Moon", "length": 1, "icon": "new", "singleDay": true } } ]}
This hook is emitted any time the current date is updated. The current date can be updated by several means:
What is passed: When this hook is emitted it will pass a DateChangeResponse object.
Examples:
Example
How to listen for the hook:
Example
Response Data: