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
plugin
: ADayjs Plugin
Return
void
Usage
Example with the BuddhistEra plugin
Inject the dayjs plugin in your page <head>
index.html
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/buddhistEra.js"></script>
Extend dayjs with the plugin, before the paint()
call
index.js
const cal = new CalHeatmap();
cal.extendDayjs(window.dayjs_plugin_buddhistEra);
cal.paint();