GenericDateConstructor
import type { GenericDateConstructor } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
The generic date constructor. Replicates the Date constructor. Used to build generic functions.
interface GenericDateConstructor <DateType extends Date = Date> {
new (): DateType;
new (value: Date | number | string): DateType;
new (
}year: number,
month: number,
date?: number,
hours?: number,
minutes?: number,
seconds?: number,
ms?: number,
): DateType;§Methods
§
new (): DateType
[src]The date constructor. Creates date with the current date and time.
@return
The date instance
§
new (value: Date | number | string): DateType
[src]The date constructor. Creates date with the passed date, number of milliseconds or string to parse.
@param value
- The date, number of milliseconds or string to parse
@return
The date instance
§
new (
[src]year: number,
month: number,
date?: number,
hours?: number,
minutes?: number,
seconds?: number,
ms?: number,
): DateTypeThe date constructor. Creates date with the passed date values (year, month, etc.) Note that the month is 0-indexed.
@param year
- The year
@param month
- The month. Note that the month is 0-indexed.
@param date
- The day of the month
@param hours
- The hours
@param minutes
- The minutes
@param seconds
- The seconds
@param ms
- The milliseconds
@return
The date instance