Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/date_fns/isDate/index.ts>default

date-fns Deno package
Very Popular
Latest
function default
import { default } from "https://deno.land/x/date_fns@v2.22.1/isDate/index.ts";

Examples

// For a valid date: const result = isDate(new Date()) //=> true

// For an invalid date: const result = isDate(new Date(NaN)) //=> true

// For some value: const result = isDate('2014-02-31') //=> false

// For an object: const result = isDate({}) //=> false

Parameters

value: unknown
  • the value to check

Returns

value is Date

true if the given value is a date