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

x/isx/date/is_valid_date.ts>isValidDate

Collection of validation functions for JavaScript data
Go to Latest
function isValidDate
import { isValidDate } from "https://deno.land/x/isx@1.1.1/date/is_valid_date.ts";

Whether the input is valid Date or not.

Examples

Example 1

import { isValidDate } from "https://deno.land/x/isx@$VERSION/date/is_valid_date.ts"
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"
assertEquals(isValidDate(new Date("2000/1/1")), true)
assertEquals(isValidDate(new Date("invalid")), false)

Parameters

input: Date
  • Any Date

Returns

boolean