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.
Declaration
DayPilot.Month.onBeforeCellExport(args)Parameters
args.cell.start- cell start (read-only)args.cell.end- cell end (read-only)args.backColor- exported cell background colorargs.text- exported plain-text cell contentargs.horizontalAlignment("left"|"right"|"center") - horizontal alignment in the exported output
Examples
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";
};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