solarnetwork-api-core
    Preparing search index...

    Function seasonForDate

    • Get a UTC season constant for a date. Seasons are groups of 3 months, e.g. Spring, Summer, Autumn, Winter.

      The returned value will be a number between 0 and 3, where:

      • (Mar, Apr, May) = 0
      • (Jun, Jul, Aug) = 1
      • (Sep, Oct, Nov) = 2
      • (Dec, Jan, Feb) = 3

      Parameters

      • date: number | Date

        either a date to get the season for, or a number representing the UTC month of a date (0 is January, 11 is December)

      • Optionallocal: boolean

        if true then use local date components, otherwise UTC

      Returns 0 | 1 | 2 | 3

      a season constant number, from 0 - 3