Caplin Trader 4.7.1

Class: module:br/parsing/LocalisedDateParsingUtil

module:br/parsing/LocalisedDateParsingUtil

Utility class for parsing dates

Constructor

new module:br/parsing/LocalisedDateParsingUtil()

Methods

parse(date, attributes) → {string}

Matches a date string and converts it to a specified output format.
Parameters:
Name Type Description
date string The date to parse
attributes object Map of configuration options
Properties
Name Type Attributes Default Description
inputFormats Array.<string> The possible input formats, expressed with Moment.js format tokens
outputFormat string The output format, expressed with Moment.js format tokens
inputLocale string <optional>
Locale override for the input
outputLocale string <optional>
Locale override for the output
endOfUnit boolean <optional>
false If true, parse ambiguous dates to the end of the month or year
Returns:
The date, expressed in the output format
Type
string