Function calendarWeekInMonth

  • The week of this month, based on counting calendar weeks. Unlike weekOfMonth() the first day of the month is always week 1, and no days count as the last week of the previous month. The week number returned can be from 1-6, as a month can span up to 6 different weeks on the calendar. The first day of the week, i.e. when the week number increases, is customizable, and defaults to Monday.

    Parameters

    • year: number

      The year

    • month: number

      The month [1-12]

    • day: number

      The day [1-31]

    • weekStartDay: WeekDay = WeekDay.Monday

      The week day to use as the start of the week

    Returns number

    Week number [1-6]

    Throws

    timezonecomplete.Argument.Year for invalid year (non-integer)

    Throws

    timezonecomplete.Argument.Month for invalid month

    Throws

    timezonecomplete.Argument.Day for invalid day of month