Functiondojo.date.locale.format

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

Create a string from a Date object using a known localized pattern. By default, this method formats both date and time from dateObject. 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

Usage

function (/*Date*/ dateObject, /*dojo.date.locale.__FormatOptions?*/ options) (view source)
parametertypedescription
dateObjectDatethe date and/or time to be formatted. If a time only is formatted, the values in the year, month, and day fields are irrelevant. The opposite is true when formatting only dates.
optionsdojo.date.locale.__FormatOptionsOptional.
fieldtypedescription
.amStringoverride strings for am in times
.datePatternStringoverride pattern with this string
.formatLengthStringchoice of long, short, medium or full (plus any custom additions). Defaults to 'short'
.fullYearBoolean(format only) use 4 digit years whenever 2 digit years are called for
.localeStringoverride the locale used to determine formatting rules
.pmStringoverride strings for pm in times
.selectorStringchoice of 'time','date' (default: date and time)
.strictBoolean(parse only) strict parsing, off by default
.timePatternStringoverride pattern with this string