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

isMatch

import { isMatch } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Match 11 February 2014 from middle-endian format:
const result = isMatch('02/11/2014', 'MM/dd/yyyy')
//=> true
@example
// Match 28th of February in Esperanto locale in the context of 2010 year:
import eo from 'date-fns/locale/eo'
const result = isMatch('28-a de februaro', "do 'de' MMMM", {
  locale: eo
})
//=> true
function isMatch(
dateStr: string,
formatStr: string,
options?: IsMatchOptions,
): boolean;
§
isMatch(dateStr: string, formatStr: string, options?: IsMatchOptions): boolean
[src]

§Parameters

§
dateStr: string
[src]
  • The date string to verify
§
formatStr: string
[src]

§Return Type

§
boolean
[src]

Is format string a match for date string?