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
15 days 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]
14 days 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
14 days ago.

Thanks a lot for the answer :)

New Reply
This reply is
Your name (optional):