daysToWeeks.d.mts 701 B

12345678910111213141516171819202122232425
  1. /**
  2. * @name daysToWeeks
  3. * @category Conversion Helpers
  4. * @summary Convert days to weeks.
  5. *
  6. * @description
  7. * Convert a number of days to a full number of weeks.
  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 days - The number of days to be converted
  12. *
  13. * @returns The number of days converted in weeks
  14. *
  15. * @example
  16. * // Convert 14 days to weeks:
  17. * const result = daysToWeeks(14)
  18. * //=> 2
  19. *
  20. * @example
  21. * // It uses trunc rounding:
  22. * const result = daysToWeeks(13)
  23. * //=> 1
  24. */
  25. export declare function daysToWeeks(days: number): number;