Skip to main content

extract-date

ai-research-agent / extractor/html-to-cite/extract-date/extract-date

Functions

extractDate()

function extractDate(
htmlobject,
extensive_search?,
original_date?,
outputformat?,
url?,
verbose?,
min_date?,
max_date?,
deferred_url_extractor?): null | string

Extract date from document using various methods

Parameters

ParameterTypeDefault valueDescription

htmlobject

Document

undefined

DOM object with article content

extensive_search?

boolean

true

perform extensive search if true

original_date?

boolean

false

return original date if true

outputformat?

string

"%Y-%m-%d"

output format

url?

string

null

URL of the page

verbose?

boolean

false

log debug messages if true

min_date?

Date

null

minimum date to consider

max_date?

Date

null

maximum date to consider

deferred_url_extractor?

boolean

false

if true, do not extract date from URL

Returns

null | string

Extracted date or null if not found

Author

ai-research-agent (2024) Based on Barbaresi (2020)

Variables

CLASS_ATTRS

const CLASS_ATTRS: Set<string>;

DATE_ATTRIBUTES

const DATE_ATTRIBUTES: Set<string>;

ITEMPROP_ATTRS

const ITEMPROP_ATTRS: Set<string>;

ITEMPROP_ATTRS_MODIFIED

const ITEMPROP_ATTRS_MODIFIED: Set<string>;

ITEMPROP_ATTRS_ORIGINAL

const ITEMPROP_ATTRS_ORIGINAL: Set<string>;

NAME_MODIFIED

const NAME_MODIFIED: Set<string>;

NON_DIGITS_REGEX

const NON_DIGITS_REGEX: RegExp;

PROPERTY_MODIFIED

const PROPERTY_MODIFIED: Set<string>;