Skip to main content
Module

x/isx/mod.ts>isDateFormat

TypeScript-first is function collections
Go to Latest
function isDateFormat
import { isDateFormat } from "https://deno.land/x/isx@1.0.0-beta.18/mod.ts";

Whether the value is Date format or not.

Parameters

value: unknown
  • Any value.
import { isDateFormat } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isDateFormat("2021-12-31T15:00:00.000Z"), true)
assertEquals(isDateFormat("2022/1/1"), true)
assertEquals(isDateFormat("invalid date"), false)

Returns

value is string