isSameMinute.d.mts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @name isSameMinute
  3. * @category Minute Helpers
  4. * @summary Are the given dates in the same minute (and hour and day)?
  5. *
  6. * @description
  7. * Are the given dates in the same minute (and hour and day)?
  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 dateLeft - The first date to check
  12. * @param dateRight - The second date to check
  13. *
  14. * @returns The dates are in the same minute (and hour and day)
  15. *
  16. * @example
  17. * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15 in the same minute?
  18. * const result = isSameMinute(
  19. * new Date(2014, 8, 4, 6, 30),
  20. * new Date(2014, 8, 4, 6, 30, 15)
  21. * )
  22. * //=> true
  23. *
  24. * @example
  25. * // Are 4 September 2014 06:30:00 and 5 September 2014 06:30:00 in the same minute?
  26. * const result = isSameMinute(
  27. * new Date(2014, 8, 4, 6, 30),
  28. * new Date(2014, 8, 5, 6, 30)
  29. * )
  30. * //=> false
  31. */
  32. export declare function isSameMinute<DateType extends Date>(
  33. dateLeft: DateType | number | string,
  34. dateRight: DateType | number | string,
  35. ): boolean;