The onBeforeCornerExport event handler fires during Excel and image export (JPEG, PNG, SVG) and direct printing. It lets you customize the appearance of the upper-left corner of the JavaScript Scheduler.

Available since version 2021.4.5145.

Declaration

DayPilot.Scheduler.onBeforeCornerExport(args)

Parameters

  • args.areas (DayPilot.AreaData[]): active areas for image export

  • args.control (DayPilot.Scheduler) - control instance (available since version 2024.4.6271)

  • args.backColor (string) - background color

  • args.fontSize (string) - font size

  • args.fontFamily (string) - font family

  • args.fontStyle ("normal" | "bold") - font style

  • args.fontColor (string) - font color

  • args.format (string) - target format set using exportAs() (read-only, available since version 2025.1.6393)

  • args.horizontalAlignment ("left" | "center" | "right") - horizontal text alignment

  • args.text (string) - exported text

  • args.verticalAlignment ("top" | "center" | "bottom") - vertical text alignment

Notes

Use this event to customize the exported corner label independently of browser rendering. The target output format is available in args.format when export is started using exportAs().

Active Areas in Image Export

For PNG, JPEG and SVG export, args.areas contains copies of the active-area descriptors prepared for this item. Replace it or assign [] to change only the exported areas. The export does not call an area’s onAfterRender DOM callback. Custom HTML remains outside the supported image-export representation.

Corner areas come from the prepared live corner. Export does not rerun onBeforeCornerRender; use this export callback to replace or clear the copied areas.

Examples

JavaScript

const scheduler = new DayPilot.Scheduler("dp", {
  onBeforeCornerExport: (args) => {
    args.text = args.control.startDate?.toString("yyyy") ?? "";
  },
  // ...
});
scheduler.init();

Angular

<daypilot-scheduler [config]="config"></daypilot-scheduler>
config: DayPilot.SchedulerConfig = {
  onBeforeCornerExport: (args) => {
    args.text = args.control.startDate?.toString("yyyy") ?? "";
  },
  // ...
};

React

<DayPilotScheduler
  onBeforeCornerExport={onBeforeCornerExport}
/>
const onBeforeCornerExport = (args) => {
  args.text = args.control.startDate?.toString("yyyy") ?? "";
};

Vue

<DayPilotScheduler
  :onBeforeCornerExport="onBeforeCornerExport"
/>
const onBeforeCornerExport = (args) => {
  args.text = args.control.startDate?.toString("yyyy") ?? "";
};

See Also

Upper-Left Corner [doc.daypilot.org]

DayPilot.Scheduler.onBeforeCornerRender

DayPilot.Scheduler.exportAs()

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

ProductLitePro
DayPilot for JavaScript