logo

/repo|v1.15.1

Typedef

Timezone:

object

calendar.jsline 556

PROPERTIES
NameTypeDescription

zones

[ Array ]

Zone array. Set the list of time zones.
The first zone element is primary
The rest zone elements are shown in left timegrid of weekly/daily view

offsetCalculator

[ function ] = null

If you define the 'offsetCalculator' property, the offset calculation is done with this function.
The offsetCalculator option allows you to set up a function that returns the timezone offset for that time using date libraries like 'js-joda' and 'moment-timezone'.
The 'offsetCalculator' option is useful when your browser does not support 'Intl.DateTimeFormat' and 'formatToPart', or you want to use the date library you are familiar with.

EXAMPLES
var cal = new Calendar('#calendar', {
  timezone: {
    zones: [
      {
        timezoneName: 'Asia/Seoul',
        displayLabel: 'GMT+09:00',
        tooltip: 'Seoul'
      },
      {
        timezoneName: 'America/New_York',
        displayLabel: 'GMT-05:00',
        tooltip: 'New York',
      }
    ],
    offsetCalculator: function(timezoneName, timestamp){
      // matches 'getTimezoneOffset()' of Date API
      // e.g. +09:00 => -540, -04:00 => 240
      return moment.tz.zone(timezoneName).utcOffset(timestamp);
    },
  }
});
Resizable