@microsoft/fast-foundation > DateFormatter
DateFormatter class
Date formatting utility
Signature:export declare class DateFormatter
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(config) | Constructs a new instance of the DateFormatter class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
date | Date | Date used for formatting | |
dayFormat | DayFormat | Formatting for the day | |
locale | string | Localization settings to use for formatting | |
monthFormat | MonthFormat | Formatting for the month | |
weekdayFormat | WeekdayFormat | Formatting for the weekday labels | |
yearFormat | YearFormat | Formatting for the year |
Methods
Method | Modifiers | Description |
---|---|---|
getDate(date, format, locale) | ||
getDateObject(date) | Helper function to make sure that the DateFormatter is working with an instance of Date | |
getDay(day, format, locale) | ||
getMonth(month, format, locale) | ||
getWeekday(weekday, format, locale) | ||
getWeekdays(format, locale) | ||
getYear(year, format, locale) |