Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "time/day-of-year/docs/types/index.d"

Index

Functions

Functions

Export assignment dayOfYear

  • dayOfYear(month?: string | number | Date, day?: undefined | number, year?: undefined | number): number
  • Returns the day of the year.

    Notes

    • By default, the function returns the day of the year for the current date (according to local time). To determine the day of the year for a particular day, provide month, day, and year arguments.
    • A month may be either a month's integer value, three letter abbreviation, or full name (case insensitive).
    • The function also accepts a Date object.
    throws

    must provide a recognized month

    throws

    an integer month argument must be on the interval [1,12]

    throws

    second argument must be greater than 0 and less than or equal to the maximum number of days in a month

    Parameters

    • Optional month: string | number | Date

      month (or Date)

    • Optional day: undefined | number

      day

    • Optional year: undefined | number

      year

    Returns number

    day of the year

    Example

    var day = dayOfYear();
    // returns <number>

    Example

    var day = dayOfYear( new Date() );
    // returns <number>

    Example

    var day = dayOfYear( 12, 31, 2017 );
    // returns 365

    Example

    var day = dayOfYear( 12, 31, 2016 );
    // returns 366