The onBeforeEventExport event handler fires by the monthly calendar during image and Excel export and direct printing. It lets you provide alternative text instead of HTML and customize the formatting.
DayPilot.Month.onBeforeEventExport(args)args.e - exported event object (read-only)
args.text - exported event text
args.fontSize - font size
args.fontFamily - font family
args.fontStyle - font style
args.fontColor - font color
args.backColor - background color
args.borderColor - border color
args.horizontalAlignment ("left" | "right" | "center") - horizontal text alignment
Use args.text when the live event content contains HTML but the exported or printed output should use a plain-text fallback. The remaining properties let you override colors, fonts, borders, and alignment for each exported event box.
JavaScript
const month = new DayPilot.Month("dp", {
onBeforeEventExport: (args) => {
args.text = args.text.toUpperCase();
args.horizontalAlignment = "center";
},
// ...
});
month.init();Angular
<daypilot-month [config]="config"></daypilot-month>config: DayPilot.MonthConfig = {
onBeforeEventExport: (args) => {
args.text = args.text.toUpperCase();
args.horizontalAlignment = "center";
},
// ...
};React
<DayPilotMonth
onBeforeEventExport={onBeforeEventExport}
{/* ... */}
/>const onBeforeEventExport = (args) => {
args.text = args.text.toUpperCase();
args.horizontalAlignment = "center";
};Vue
<DayPilotMonth
@beforeEventExport="onBeforeEventExport"
<!-- ... -->
/>const onBeforeEventExport = (args) => {
args.text = args.text.toUpperCase();
args.horizontalAlignment = "center";
};Client-Side Image Export [doc.daypilot.org]
Printing [doc.daypilot.org]