Preparing search index...

    Function getSignByDate

    • Retrieve the astrological sign corresponding to a given date, with optional translations for the specified language.

      Parameters

      • date: Date

        The date for which the corresponding astrological sign is to be retrieved.

      • Optionallang: "en" | "es" = 'en'

        The language code for which translations are needed. Defaults to 'en'.

      Returns null | Sign

      An object representing the astrological sign with translated values or null if the sign is not found.

      Will throw an error if the provided date is invalid.

      import { getSignByDate } from 'western-signs';

      // Retrieve the sign for May 15 in English
      const signData = getSignByDate(new Date(1813, 4, 5));
      console.log(signData);
      // Output:
      // {
      // name: 'Taurus',
      // element: 'Earth',
      // modality: 'Fixed',
      // rulingPlanet: 'Venus',
      // symbol: '♉',
      // [...]
      // }