registration
This commit is contained in:
21
frontend/style/node_modules/date-fns/isValid.js
generated
vendored
21
frontend/style/node_modules/date-fns/isValid.js
generated
vendored
@@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
exports.isValid = isValid;
|
||||
var _index = require("./isDate.js");
|
||||
var _index2 = require("./toDate.js");
|
||||
import { isDate } from "./isDate.js";
|
||||
import { toDate } from "./toDate.js";
|
||||
|
||||
/**
|
||||
* @name isValid
|
||||
@@ -15,8 +13,6 @@ var _index2 = require("./toDate.js");
|
||||
*
|
||||
* Time value of Date: http://es5.github.io/#x15.9.1.1
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @returns The date is valid
|
||||
@@ -27,7 +23,7 @@ var _index2 = require("./toDate.js");
|
||||
* //=> true
|
||||
*
|
||||
* @example
|
||||
* // For the value, convertable into a date:
|
||||
* // For the value, convertible into a date:
|
||||
* const result = isValid(1393804800000)
|
||||
* //=> true
|
||||
*
|
||||
@@ -36,10 +32,9 @@ var _index2 = require("./toDate.js");
|
||||
* const result = isValid(new Date(''))
|
||||
* //=> false
|
||||
*/
|
||||
function isValid(date) {
|
||||
if (!(0, _index.isDate)(date) && typeof date !== "number") {
|
||||
return false;
|
||||
}
|
||||
const _date = (0, _index2.toDate)(date);
|
||||
return !isNaN(Number(_date));
|
||||
export function isValid(date) {
|
||||
return !((!isDate(date) && typeof date !== "number") || isNaN(+toDate(date)));
|
||||
}
|
||||
|
||||
// Fallback for modularized imports:
|
||||
export default isValid;
|
||||
|
||||
Reference in New Issue
Block a user