Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

isValid

import { isValid } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// For the valid date:
const result = isValid(new Date(2014, 1, 31))
//=> true
@example
// For the value, convertable into a date:
const result = isValid(1393804800000)
//=> true
@example
// For the invalid date:
const result = isValid(new Date(''))
//=> false
function isValid(date: unknown): boolean;
§
isValid(date: unknown): boolean
[src]

§Parameters

§
date: unknown
[src]
  • The date to check

§Return Type

§
boolean
[src]

The date is valid