search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Angular Scheduler TimeHeader Display Week Wording

Asked by Jason
4 years ago.

Hi,
I follow the zoom tutorial https://code.daypilot.org/12302/angular-scheduler-zoom
However how to display the zoom timeheader for week example Week 1 Week 2 as now only show weeknumber only

{
        name: 'Week',
        properties: {
          scale: 'CellDuration',
          cellDuration: 720,
          cellWidth: 35,
          weekStarts: 1,
          timeHeaders: [{groupBy: 'Month'}, {groupBy: 'Week' , format : 'Week ?'}, {groupBy: 'Day'}, {groupBy: 'Cell', format: 'tt'}],
          startDate: function(args) { return args.date.firstDayOfWeek().toDateLocal(); },
          days: function(args) { return args.date.daysInMonth(); },
        }
      },
Answer posted by Dan Letecky [DayPilot]
4 years ago.

You can override the text in the time header using onBeforeTimeHeaderRender event handler:

https://doc.daypilot.org/scheduler/time-header-customization/

Comment posted by CC
4 years ago.

Hi Dan,

How to show the week word only on in zoom 2? As it overview all the zoom with header level 1

onBeforeTimeHeaderRender = function(args) {
  if (args.header.level === 1) {
    args.header.html = "Week " + args.header.start.weekNumberISO();
  }
Comment posted by Dan Letecky [DayPilot]
4 years ago.

Like this:

onBeforeTimeHeaderRender = function(args) {
  if (args.header.level === 1 && this.config.zoom === 2) {
    args.header.html = "Week " + args.header.start.weekNumberISO();
  }
Comment posted by CC
4 years ago.

Hi Dan,
it show the error if add this && this.config.zoom === 2 and the scheduler will missing

ERROR TypeError: Cannot read property 'zoom' of undefined
    at DayPilot.Scheduler.onBeforeTimeHeaderRender
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.