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.
Declaration
DayPilot.Month.onBeforeEventExport(args)Parameters
args.e- exported event object (read-only)args.text- exported event textargs.fontSize- font sizeargs.fontFamily- font familyargs.fontStyle- font styleargs.fontColor- font colorargs.backColor- background colorargs.borderColor- border colorargs.horizontalAlignment("left"|"right"|"center") - horizontal text alignment
Notes
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.
Examples
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";
};See Also
Client-Side Image Export [doc.daypilot.org]
Printing [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot