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

How to show week number in Monthly calendar View?

Asked by Md. Mahady Hasan
5 years ago.

I want to show Week number on the left of the Monthly Calendar. Just like Week-numbers in the Navigator.

Answer posted by Dan Letecky [DayPilot]
5 years ago.

You can show the week numbers in the first cell using onBeforeCellRender.

Example for ISO week number (week starting on Monday):

dp.onBeforeCellRender = function(args) {
  if (args.cell.start.getDayOfWeek() === 1) {
      args.cell.areas = [
          {left: 2, top: 2, html: "Week " + args.cell.start.weekNumberISO() }
      ];
  }
};

See also:
https://api.daypilot.org/daypilot-month-onbeforecellrender/
https://api.daypilot.org/daypilot-date-weeknumber/
https://api.daypilot.org/daypilot-date-weeknumberiso/

Comment posted by Md. Mahady Hasan
5 years ago.

Thanks a lot for the answer :)

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.