Skip to main content Link Menu Expand (external link) Document Search Copy Copied

extendDayjs()

Extend the dayjs library with plugins

const cal = new CalHeatmap();
cal.extend(PluginFunc);

The built-in dayjs is already shipped with some plugins, see the DateHelper for the list of plugins.

Arguments:


Usage

Example with the BuddhistEra plugin

Inject the dayjs plugin in your page <head>

<script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/buddhistEra.js"></script>

Extend dayjs with the plugin, before any paint() call

const cal = new CalHeatmap();
cal.extendDayjs(window.dayjs_plugin_buddhistEra);