registration
This commit is contained in:
15
frontend/style/node_modules/date-fns/constructNow.js
generated
vendored
15
frontend/style/node_modules/date-fns/constructNow.js
generated
vendored
@@ -1,6 +1,4 @@
|
||||
"use strict";
|
||||
exports.constructNow = constructNow;
|
||||
var _index = require("./constructFrom.js");
|
||||
import { constructFrom } from "./constructFrom.js";
|
||||
|
||||
/**
|
||||
* @name constructNow
|
||||
@@ -15,8 +13,6 @@ var _index = require("./constructFrom.js");
|
||||
*
|
||||
* 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
|
||||
@@ -25,13 +21,16 @@ var _index = require("./constructFrom.js");
|
||||
* 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));
|
||||
* }
|
||||
*/
|
||||
function constructNow(date) {
|
||||
return (0, _index.constructFrom)(date, Date.now());
|
||||
export function constructNow(date) {
|
||||
return constructFrom(date, Date.now());
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default constructNow;
|
||||
|
||||
Reference in New Issue
Block a user