Skip to main content

@microsoft/fast-foundation > DateFormatter

DateFormatter class

Date formatting utility

Signature:
export declare class DateFormatter 

Constructors

ConstructorModifiersDescription
(constructor)(config)Constructs a new instance of the DateFormatter class

Properties

PropertyModifiersTypeDescription
dateDateDate used for formatting
dayFormatDayFormatFormatting for the day
localestringLocalization settings to use for formatting
monthFormatMonthFormatFormatting for the month
weekdayFormatWeekdayFormatFormatting for the weekday labels
yearFormatYearFormatFormatting for the year

Methods

MethodModifiersDescription
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)