1 | import type { ContextOptions, DateArg } from "./types.js";
|
2 | /**
|
3 | * The {@link endOfHour} function options.
|
4 | */
|
5 | export interface EndOfHourOptions<DateType extends Date = Date>
|
6 | extends ContextOptions<DateType> {}
|
7 | /**
|
8 | * @name endOfHour
|
9 | * @category Hour Helpers
|
10 | * @summary Return the end of an hour for the given date.
|
11 | *
|
12 | * @description
|
13 | * Return the end of an hour for the given date.
|
14 | * The result will be in the local timezone.
|
15 | *
|
16 | * @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).
|
17 | * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
18 | *
|
19 | * @param date - The original date
|
20 | * @param options - An object with options
|
21 | *
|
22 | * @returns The end of an hour
|
23 | *
|
24 | * @example
|
25 | * // The end of an hour for 2 September 2014 11:55:00:
|
26 | * const result = endOfHour(new Date(2014, 8, 2, 11, 55))
|
27 | * //=> Tue Sep 02 2014 11:59:59.999
|
28 | */
|
29 | export declare function endOfHour<
|
30 | DateType extends Date,
|
31 | ResultDate extends Date = DateType,
|
32 | >(
|
33 | date: DateArg<DateType>,
|
34 | options?: EndOfHourOptions<ResultDate> | undefined,
|
35 | ): ResultDate;
|