DayPilot.Month.onBeforeCellExport

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 color

  • args.text - exported plain-text cell content

  • args.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]

DayPilot.Month Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript