Functiondojo.date.locale.parse

dojo.require("dojo.date.locale");
defined in dojo/date/locale.js

Usage

String

/ value, /

dojo.date.locale.__FormatOptions

?*/ options)

(view source)

function (/*

parameter

type

description

value

String

A string representation of a date

options

dojo.date.locale.__FormatOptions

field

type

description

.am

String

override strings for am in times

.datePattern

String

override pattern with this string

.formatLength

String

choice of long, short, medium or full (plus any custom additions). Defaults to 'short'

.fullYear

Boolean

(format only) use 4 digit years whenever 2 digit years are called for

.locale

String

override the locale used to determine formatting rules

.pm

String

override strings for pm in times

.selector

String

choice of 'time','date' (default: date and time)

.strict

Boolean

(parse only) strict parsing, off by default

.timePattern

String

override pattern with this string

Optional.

Create a Date object from a string using a known localized pattern. By default, this method parses looking for both date and time in the string. Formatting patterns are chosen appropriate to the locale. Different formatting lengths may be chosen, with "full" used by default. Custom patterns may be used or registered with translations using the dojo.date.locale.addCustomFormats method.

Formatting patterns are implemented using the syntax described at unicode.org When two digit years are used, a century is chosen according to a sliding window of 80 years before and 20 years after present year, for both yy and yyyy patterns. year