Format a Date object as a String, using locale-specific settings, relative to the current date or some other date.
Create a string from a Date object using the most significant information and a known localized pattern. This method formats both the date and time from dateObject. Formatting patterns are chosen appropriate to the locale.
If the day portion of the date falls within the current date (or the relativeDate option, if present), then the time will be all that is displayed
If the day portion of the date falls within the past week (or the week preceding relativeDate, if present), then the display will show day of week and time. This functionality can be turned off by setting weekCheck to false.
If the year portion of the date falls within the current year (or the year portion of relativeDate, if present), then the display will show month and day.
Otherwise, this function is equivalent to calling dojo.date.format with formatLength of "medium"
Parameter | Type | Description |
---|---|---|
dateObject | Date | the date and time to be formatted. |
options | Object |
Optional An object with the following properties:
|