registration
This commit is contained in:
12
frontend/style/node_modules/date-fns/constructNow.d.ts
generated
vendored
12
frontend/style/node_modules/date-fns/constructNow.d.ts
generated
vendored
@@ -1,3 +1,4 @@
|
||||
import type { ContextFn, DateArg } from "./types.js";
|
||||
/**
|
||||
* @name constructNow
|
||||
* @category Generic Helpers
|
||||
@@ -11,8 +12,6 @@
|
||||
*
|
||||
* It defaults to `Date` if the passed reference date is a number or a string.
|
||||
*
|
||||
* @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).
|
||||
*
|
||||
* @param date - The reference date to take constructor from
|
||||
*
|
||||
* @returns Current date initialized using the given date constructor
|
||||
@@ -21,13 +20,14 @@
|
||||
* import { constructNow, isSameDay } from 'date-fns'
|
||||
*
|
||||
* function isToday<DateType extends Date>(
|
||||
* date: DateType | number | string,
|
||||
* date: DateArg<DateType>,
|
||||
* ): boolean {
|
||||
* // If we were to use `new Date()` directly, the function would behave
|
||||
* // differently in different timezones and return false for the same date.
|
||||
* return isSameDay(date, constructNow(date));
|
||||
* }
|
||||
*/
|
||||
export declare function constructNow<DateType extends Date>(
|
||||
date: DateType | number | string,
|
||||
): DateType;
|
||||
export declare function constructNow<
|
||||
DateType extends Date,
|
||||
ResultDate extends Date = DateType,
|
||||
>(date: DateArg<DateType> | ContextFn<ResultDate> | undefined): ResultDate;
|
||||
|
||||
Reference in New Issue
Block a user