UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

10 lines (9 loc) 490 B
import { TimeUnit } from '../convert-units/index.js'; /** * Determines if two dates are the same. If you want to limit the granularity to a unit other than milliseconds, pass it as the second * parameter. * * When including a second parameter, it will match all units equal or larger. For example, if passing in month will check month and year, * or if passing in day will check day, month, and year. */ export declare function isSameDate(a: Date, b: Date, unit?: TimeUnit): boolean;