registration
This commit is contained in:
24
frontend/style/node_modules/date-fns/isThisHour.js
generated
vendored
24
frontend/style/node_modules/date-fns/isThisHour.js
generated
vendored
@@ -1,7 +1,10 @@
|
||||
"use strict";
|
||||
exports.isThisHour = isThisHour;
|
||||
var _index = require("./constructNow.js");
|
||||
var _index2 = require("./isSameHour.js");
|
||||
import { constructNow } from "./constructNow.js";
|
||||
import { isSameHour } from "./isSameHour.js";
|
||||
import { toDate } from "./toDate.js";
|
||||
|
||||
/**
|
||||
* The {@link isThisHour} function options.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name isThisHour
|
||||
@@ -12,9 +15,8 @@ var _index2 = require("./isSameHour.js");
|
||||
* @description
|
||||
* Is the given date in the same hour as the current date?
|
||||
*
|
||||
* @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 date to check
|
||||
* @param options - An object with options
|
||||
*
|
||||
* @returns The date is in this hour
|
||||
*
|
||||
@@ -24,6 +26,12 @@ var _index2 = require("./isSameHour.js");
|
||||
* const result = isThisHour(new Date(2014, 8, 25, 18))
|
||||
* //=> true
|
||||
*/
|
||||
function isThisHour(date) {
|
||||
return (0, _index2.isSameHour)(date, (0, _index.constructNow)(date));
|
||||
export function isThisHour(date, options) {
|
||||
return isSameHour(
|
||||
toDate(date, options?.in),
|
||||
constructNow(options?.in || date),
|
||||
);
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default isThisHour;
|
||||
|
||||
Reference in New Issue
Block a user