startOfDecade.d.mts 730 B

12345678910111213141516171819202122
  1. /**
  2. * @name startOfDecade
  3. * @category Decade Helpers
  4. * @summary Return the start of a decade for the given date.
  5. *
  6. * @description
  7. * Return the start of a decade for the given date.
  8. *
  9. * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
  10. *
  11. * @param date - The original date
  12. *
  13. * @returns The start of a decade
  14. *
  15. * @example
  16. * // The start of a decade for 21 October 2015 00:00:00:
  17. * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))
  18. * //=> Jan 01 2010 00:00:00
  19. */
  20. export declare function startOfDecade<DateType extends Date>(
  21. date: DateType | number | string,
  22. ): DateType;