⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
date-fns
/
is_valid
/
Edit File: index.js
var isDate = require('../is_date/index.js') /** * @category Common Helpers * @summary Is the given date valid? * * @description * Returns false if argument is Invalid Date and true otherwise. * Invalid Date is a Date, whose time value is NaN. * * Time value of Date: http://es5.github.io/#x15.9.1.1 * * @param {Date} date - the date to check * @returns {Boolean} the date is valid * @throws {TypeError} argument must be an instance of Date * * @example * // For the valid date: * var result = isValid(new Date(2014, 1, 31)) * //=> true * * @example * // For the invalid date: * var result = isValid(new Date('')) * //=> false */ function isValid (dirtyDate) { if (isDate(dirtyDate)) { return !isNaN(dirtyDate) } else { throw new TypeError(toString.call(dirtyDate) + ' is not an instance of Date') } } module.exports = isValid
Simpan