Variable DateHelpersConst

DateHelpers: {
    daysAgo: ((nbOfDays?) => Date);
    format: ((date?, options?) => string);
    inDays: ((nbOfDays?) => Date);
    isAfter: ((date1, date2) => boolean);
    isAfterDaysAgo: ((date, nbOfDays?) => boolean);
    isAfterInDays: ((date, nbOfDays?) => boolean);
    isBefore: ((date1, date2) => boolean);
    isBeforeDaysAgo: ((date, nbOfDays?) => boolean);
    isBeforeInDays: ((date, nbOfDays?) => boolean);
    isDaysAgo: ((date, nbOfDays?) => boolean);
    isFuture: ((date) => boolean);
    isInDays: ((date, nbOfDays?) => boolean);
    isPast: ((date) => boolean);
    isSameDay: ((date1, date2) => boolean);
    isToday: ((date) => boolean);
    isTomorrow: ((date) => boolean);
    isYesterday: ((date) => boolean);
    now: (() => Date);
    today: ((options?) => string);
    tomorrow: (() => Date);
    yesterday: (() => Date);
} = ...

Type declaration

  • daysAgo: ((nbOfDays?) => Date)

    Gets a Date corresponding to the given number of days in the past.

    Param: nbOfDays

    The number of days in the past.

    Returns

    a Date object.

      • (nbOfDays?): Date
      • Gets a Date corresponding to the given number of days in the past.

        Parameters

        • nbOfDays: number = 1

          The number of days in the past.

        Returns Date

        a Date object.

  • format: ((date?, options?) => string)

    Formats a date.

    Param: date

    The date to format.

    Param: options

    Options.

    Returns

    The given date formated accordingly to the given options.

      • (date?, options?): string
      • Formats a date.

        Parameters

        Returns string

        The given date formated accordingly to the given options.

  • inDays: ((nbOfDays?) => Date)

    Gets a Date corresponding to the given number of days in the future.

    Param: nbOfDays

    The number of days in the future.

    Returns

    a Date object.

      • (nbOfDays?): Date
      • Gets a Date corresponding to the given number of days in the future.

        Parameters

        • nbOfDays: number = 1

          The number of days in the future.

        Returns Date

        a Date object.

  • isAfter: ((date1, date2) => boolean)

    Tests whether the first given date is after the second given date.

    Param: date

    The first date to compare.

    Param: date

    The second date to compare.

    Returns

    true if the first given date is after the second given date, false otherwise.

      • (date1, date2): boolean
      • Tests whether the first given date is after the second given date.

        Parameters

        • date1: number | Date
        • date2: number | Date

        Returns boolean

        true if the first given date is after the second given date, false otherwise.

  • isAfterDaysAgo: ((date, nbOfDays?) => boolean)

    Tests whether the given date happens after the given number of days in the past relatively to today.

    Param: date

    The date to compare.

    Param: nbOfDays

    The number of days in the future.

    Returns

    true if the given date happens after today - nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happens after the given number of days in the past relatively to today.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

          The number of days in the future.

        Returns boolean

        true if the given date happens after today - nbOfDays, false otherwise.

  • isAfterInDays: ((date, nbOfDays?) => boolean)

    Tests whether the given date happens after the given number of days in the future relatively to today.

    Param: date

    The date to compare.

    Param: nbOfDays

    The number of days in the future.

    Returns

    true if the given date happens after today + nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happens after the given number of days in the future relatively to today.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

          The number of days in the future.

        Returns boolean

        true if the given date happens after today + nbOfDays, false otherwise.

  • isBefore: ((date1, date2) => boolean)

    Tests whether the first given date is before the second given date.

    Param: date

    The first date to compare.

    Param: date

    The second date to compare.

    Returns

    true if the first given date is before the second given date, false otherwise.

      • (date1, date2): boolean
      • Tests whether the first given date is before the second given date.

        Parameters

        • date1: number | Date
        • date2: number | Date

        Returns boolean

        true if the first given date is before the second given date, false otherwise.

  • isBeforeDaysAgo: ((date, nbOfDays?) => boolean)

    Tests whether the given date happened before the given number of days in the past relatively to today.

    Param: date

    The date to compare.

    Param: nbOfDays

    The number of days in the future.

    Returns

    true if the given date happened before today - nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happened before the given number of days in the past relatively to today.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

          The number of days in the future.

        Returns boolean

        true if the given date happened before today - nbOfDays, false otherwise.

  • isBeforeInDays: ((date, nbOfDays?) => boolean)

    Tests whether the given date happened before the given number of days in the future relatively to today.

    Param: date

    The date to compare.

    Param: nbOfDays

    The number of days in the future.

    Returns

    true if the given date happened before today + nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happened before the given number of days in the future relatively to today.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

          The number of days in the future.

        Returns boolean

        true if the given date happened before today + nbOfDays, false otherwise.

  • isDaysAgo: ((date, nbOfDays?) => boolean)

    Tests whether the given date happened the given number of days in the past.

    Param: date

    The date to compare.

    Returns

    true if the given date happened today - nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happened the given number of days in the past.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

        Returns boolean

        true if the given date happened today - nbOfDays, false otherwise.

  • isFuture: ((date) => boolean)

    Tests whether the given date happens after today.

    Param: date

    The date to compare.

    Returns

    true if the given date happens after today, false otherwise.

      • (date): boolean
      • Tests whether the given date happens after today.

        Parameters

        • date: Date

          The date to compare.

        Returns boolean

        true if the given date happens after today, false otherwise.

  • isInDays: ((date, nbOfDays?) => boolean)

    Tests whether the given date happens the given number of days in the future.

    Param: date

    The date to compare.

    Returns

    true if the given date happens today + nbOfDays, false otherwise.

      • (date, nbOfDays?): boolean
      • Tests whether the given date happens the given number of days in the future.

        Parameters

        • date: Date

          The date to compare.

        • nbOfDays: number = 1

        Returns boolean

        true if the given date happens today + nbOfDays, false otherwise.

  • isPast: ((date) => boolean)

    Tests whether the given date happened before today.

    Param: date

    The date to compare.

    Returns

    true if the given date happened before today, false otherwise.

      • (date): boolean
      • Tests whether the given date happened before today.

        Parameters

        • date: Date

          The date to compare.

        Returns boolean

        true if the given date happened before today, false otherwise.

  • isSameDay: ((date1, date2) => boolean)

    Tests whether the first given date is the same as the second given date.

    Param: date

    The first date to compare.

    Param: date

    The second date to compare.

    Returns

    true if the first given date is the same as the second given date, false otherwise.

      • (date1, date2): boolean
      • Tests whether the first given date is the same as the second given date.

        Parameters

        • date1: Date
        • date2: Date

        Returns boolean

        true if the first given date is the same as the second given date, false otherwise.

  • isToday: ((date) => boolean)

    Tests whether the given date happens today.

    Param: date

    The date to compare.

    Returns

    true if the given date happens today, false otherwise.

      • (date): boolean
      • Tests whether the given date happens today.

        Parameters

        • date: Date

          The date to compare.

        Returns boolean

        true if the given date happens today, false otherwise.

  • isTomorrow: ((date) => boolean)

    Tests whether the given date happens tomorrow.

    Param: date

    The date to compare.

    Returns

    true if the given date happens tomorrow, false otherwise.

      • (date): boolean
      • Tests whether the given date happens tomorrow.

        Parameters

        • date: Date

          The date to compare.

        Returns boolean

        true if the given date happens tomorrow, false otherwise.

  • isYesterday: ((date) => boolean)

    Tests whether the given date happened yesterday.

    Param: date

    The date to compare.

    Returns

    true if the given date happened yesterday, false otherwise.

      • (date): boolean
      • Tests whether the given date happened yesterday.

        Parameters

        • date: Date

          The date to compare.

        Returns boolean

        true if the given date happened yesterday, false otherwise.

  • now: (() => Date)

    Gets a Date corresponding to now.

    Returns

    a Date object.

      • (): Date
      • Gets a Date corresponding to now.

        Returns Date

        a Date object.

  • today: ((options?) => string)

    Gets today's date as a string formated in the format specified in the given options parameter.

    Param: separator

    The separator between day, month and year.

    Returns

    today's date as a string.

      • (options?): string
      • Gets today's date as a string formated in the format specified in the given options parameter.

        Parameters

        Returns string

        today's date as a string.

  • tomorrow: (() => Date)

    Gets a Date corresponding to yesterday.

    Returns

    a Date object.

      • (): Date
      • Gets a Date corresponding to yesterday.

        Returns Date

        a Date object.

  • yesterday: (() => Date)

    Gets a Date corresponding to yesterday.

    Returns

    a Date object.

      • (): Date
      • Gets a Date corresponding to yesterday.

        Returns Date

        a Date object.

Generated using TypeDoc