FunctionsExtractorHtml to citeExtract date

Extract Date

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

CLASS_ATTRS

const CLASS_ATTRS: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:202


DATE_ATTRIBUTES

const DATE_ATTRIBUTES: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:81


ITEMPROP_ATTRS

const ITEMPROP_ATTRS: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:196


ITEMPROP_ATTRS_MODIFIED

const ITEMPROP_ATTRS_MODIFIED: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:193


ITEMPROP_ATTRS_ORIGINAL

const ITEMPROP_ATTRS_ORIGINAL: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:187


NAME_MODIFIED

const NAME_MODIFIED: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:156


NON_DIGITS_REGEX

const NON_DIGITS_REGEX: RegExp;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:205


PROPERTY_MODIFIED

const PROPERTY_MODIFIED: Set<string>;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:166


extractDate()

function extractDate(
   htmlobject: Document, 
   extensive_search?: boolean, 
   original_date?: boolean, 
   outputformat?: string, 
   url?: string, 
   verbose?: boolean, 
   min_date?: Date, 
   max_date?: Date, 
   deferred_url_extractor?: boolean): string;

Defined in: src/extractor/html-to-cite/extract-date/extract-date.js:957

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

string

Extracted date or null if not found

Author

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