IsDate(value) Last updated: 16. Mar 2023

Checks if value is a date type.

Parameters

Name Type Description
value object Value to try to check if is a date can be convert

Returns

True if the value is or can be converted to a date.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let text = "2023-01-01"; // a date
let text2 = "20230101"; // not a date

if (docly.IsDate(text, 5)) write("Text is a date!");
if (docly.IsDate(text2, 8)) write("Text2 is a date!");