Skip to main content

parseDate

Stentor API Reference


Stentor API Reference / stentor-utils/src / parseDate

Function: parseDate()

parseDate(parsable, returnOnly?): DateTime

Defined in: packages/stentor-utils/src/dateTime.ts:254

Parses the date within the string. Returns undefined if it cannot parse one.

It does not handle date periods such as "last week" or "last month".

Note: This is a wrapper around chrono-node parseDate. See https://github.com/wanasit/chrono for more information.

Parameters​

parsable​

string

returnOnly?​

"time" | "date"

Returns​

DateTime