Class DayOfWeekHelper

Hierarchy

  • DayOfWeekHelper

Constructors

Properties

Methods

Constructors

Properties

ENUMS: DayOfWeek[] = ...

Private cache of all the constants.

Methods

  • Returns the day-of-week that is the specified number of days before this one.

    The calculation rolls around the start of the year from Monday to Sunday. The specified period may be negative.

    This instance is immutable and unaffected by this method call.

    Returns

    the resulting day-of-week, not null

    Parameters

    • days: number

      the days to subtract, positive or negative

    • dayOfWeek: DayOfWeek

      the DayOfWeek from where the subtraction is computed

    Returns DayOfWeek

  • Obtains an instance of DayOfWeek from an int value.

    DayOfWeek is an enum representing the 7 days of the week. This factory allows the enum to be obtained from the int value. The int value follows the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).

    Returns

    the day-of-week singleton, not null

    Throws

    DateTimeException if the day-of-week is invalid

    Parameters

    • dayOfWeek: number

      the day-of-week to represent, from 1 (Monday) to 7 (Sunday)

    Returns DayOfWeek

  • Returns the day-of-week that is the specified number of days after this one.

    The calculation rolls around the end of the week from Sunday to Monday. The specified period may be negative.

    This instance is immutable and unaffected by this method call.

    Returns

    the resulting day-of-week, not null

    Parameters

    • days: number

      the days to add, positive or negative

    • dayOfWeek: DayOfWeek

      the DayOfWeek from where the addition is computed

    Returns DayOfWeek

  • Gets the day-of-week int value.

    The values are numbered following the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).

    Returns

    the day-of-week, from 1 (Monday) to 7 (Sunday)

    Parameters

    Returns number

Generated using TypeDoc