The onBeforeCellExport event handler fires during image and Excel export and direct printing in the monthly calendar. It lets you provide alternative text instead of HTML and customize the formatting.
DayPilot.Month.onBeforeCellExport(args)args.cell.start - cell start (read-only)
args.cell.end - cell end (read-only)
args.backColor - exported cell background color
args.text - exported plain-text cell content
args.horizontalAlignment ("left" | "right" | "center") - horizontal alignment in the exported output
JavaScript
const month = new DayPilot.Month("dp", {
onBeforeCellExport: (args) => {
args.text = args.cell.start.toString("d");
args.horizontalAlignment = "center";
},
// ...
});
month.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onBeforeCellExport: (args) => {
args.text = args.cell.start.toString("d");
args.horizontalAlignment = "center";
},
// ...
};React
<DayPilotMonth
onBeforeCellExport={onBeforeCellExport}
{/* ... */}
/>const onBeforeCellExport = (args) => {
args.text = args.cell.start.toString("d");
args.horizontalAlignment = "center";
};Vue
<DayPilotMonth
@beforeCellExport="onBeforeCellExport"
<!-- ... -->
/>const onBeforeCellExport = (args) => {
args.text = args.cell.start.toString("d");
args.horizontalAlignment = "center";
};Client-Side Image Export [doc.daypilot.org]
Printing [doc.daypilot.org]