DefaultDateTimeFormatInfo class
Default implementation of DateTimeFormatInfo interface, using values from the CLDR root locale. <p> Users who need to create their own DateTimeFormatInfo implementation are encouraged to extend this class so their implementation won't break when new methods are added.
class DefaultDateTimeFormatInfo implements DateTimeFormatInfo { DefaultDateTimeFormatInfo(); List<String> ampms() { return ["AM", "PM" ]; } String dateFormat() { return dateFormatMedium(); } String dateFormatFull() { return "EEEE, y MMMM dd"; } String dateFormatLong() { return "y MMMM d"; } String dateFormatMedium() { return "y MMM d"; } String dateFormatShort() { return "yyyy-MM-dd"; } String dateTime(String timePattern, String datePattern) { return dateTimeMedium(timePattern, datePattern); } String dateTimeFull(String timePattern, String datePattern) { return datePattern + " " + timePattern; } String dateTimeLong(String timePattern, String datePattern) { return datePattern + " " + timePattern; } String dateTimeMedium(String timePattern, String datePattern) { return datePattern + " " + timePattern; } String dateTimeShort(String timePattern, String datePattern) { return datePattern + " " + timePattern; } List<String> erasFull() { return ["Before Christ", "Anno Domini"]; } List<String> erasShort() { return ["BC", "AD"]; } int firstDayOfTheWeek() { return 1; } String formatDay() { return "d"; } String formatHour12Minute() { return "h:mm a"; } String formatHour12MinuteSecond() { return "h:mm:ss a"; } String formatHour24Minute() { return "HH:mm"; } String formatHour24MinuteSecond() { return "HH:mm:ss"; } String formatMinuteSecond() { return "mm:ss"; } String formatMonthAbbrev() { return "LLL"; } String formatMonthAbbrevDay() { return "MMM d"; } String formatMonthFull() { return "LLLL"; } String formatMonthFullDay() { return "MMMM d"; } String formatMonthFullWeekdayDay() { return "EEEE MMMM d"; } String formatMonthNumDay() { return "M-d"; } String formatYear() { return "y"; } String formatYearMonthAbbrev() { return "y MMM"; } String formatYearMonthAbbrevDay() { return "y MMM d"; } String formatYearMonthFull() { return "y MMMM"; } String formatYearMonthFullDay() { return "y MMMM d"; } String formatYearMonthNum() { return "y-M"; } String formatYearMonthNumDay() { return "y-M-d"; } String formatYearMonthWeekdayDay() { return "EEE, y MMM d"; } String formatYearQuarterFull() { return "y QQQQ"; } String formatYearQuarterShort() { return "y Q"; } List<String> monthsFull() { return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; } List<String> monthsFullStandalone() { return monthsFull(); } List<String> monthsNarrow() { return ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D" ]; } List<String> monthsNarrowStandalone() { return monthsNarrow(); } List<String> monthsShort() { return [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; } List<String> monthsShortStandalone() { return monthsShort(); } List<String> quartersFull() { return [ "1st quarter", "2nd quarter", "3rd quarter", "4th quarter" ]; } List<String> quartersShort() { return [ "Q1", "Q2", "Q3", "Q4" ]; } String timeFormat() { return timeFormatMedium(); } String timeFormatFull() { return "HH:mm:ss zzzz"; } String timeFormatLong() { return "HH:mm:ss z"; } String timeFormatMedium() { return "HH:mm:ss"; } String timeFormatShort() { return "HH:mm"; } List<String> weekdaysFull() { return [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]; } List<String> weekdaysFullStandalone() { return weekdaysFull(); } List<String> weekdaysNarrow() { return [ "S", "M", "T", "W", "T", "F", "S" ]; } List<String> weekdaysNarrowStandalone() { return weekdaysNarrow(); } List<String> weekdaysShort() { return [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; } List<String> weekdaysShortStandalone() { return weekdaysShort(); } int weekendEnd() { return 0; } int weekendStart() { return 6; } }
Subclasses
Implements
Constructors
Methods
List<String> ampms() #
Returns array of strings containing abbreviations for Ante Meridiem and Post Meridiem.
List<String> ampms() { return ["AM", "PM" ]; }
String dateFormat() #
Returns a safe default date format.
String dateFormat() { return dateFormatMedium(); }
String dateFormatFull() #
Returns a "full" date format.
String dateFormatFull() { return "EEEE, y MMMM dd"; }
String dateFormatLong() #
Returns a "long" date format.
String dateFormatLong() { return "y MMMM d"; }
String dateFormatMedium() #
Returns a "medium" date format.
String dateFormatMedium() { return "y MMM d"; }
String dateFormatShort() #
Returns a "short" date format.
String dateFormatShort() { return "yyyy-MM-dd"; }
String dateTime(String timePattern, String datePattern) #
Returns a date/time format from a date format pattern and a time format pattern, using the locale default joining.
@param timePattern the time pattern String @param datePattern the data pattern String
String dateTime(String timePattern, String datePattern) { return dateTimeMedium(timePattern, datePattern); }
String dateTimeFull(String timePattern, String datePattern) #
Returns a date/time format from a date format pattern and a time format pattern, using "full" joining.
@param timePattern the time pattern String @param datePattern the data pattern String
String dateTimeFull(String timePattern, String datePattern) { return datePattern + " " + timePattern; }
String dateTimeLong(String timePattern, String datePattern) #
Returns a date/time format from a date format pattern and a time format pattern, using "full" joining.
@param timePattern the time pattern String @param datePattern the data pattern String
String dateTimeLong(String timePattern, String datePattern) { return datePattern + " " + timePattern; }
String dateTimeMedium(String timePattern, String datePattern) #
Returns a date/time format from a date format pattern and a time format pattern, using "full" joining.
@param timePattern the time pattern String @param datePattern the data pattern String
String dateTimeMedium(String timePattern, String datePattern) { return datePattern + " " + timePattern; }
String dateTimeShort(String timePattern, String datePattern) #
Returns a date/time format from a date format pattern and a time format pattern, using "full" joining.
@param timePattern the time pattern String @param datePattern the data pattern String
String dateTimeShort(String timePattern, String datePattern) { return datePattern + " " + timePattern; }
List<String> erasFull() #
Returns an array of the full era names.
List<String> erasFull() { return ["Before Christ", "Anno Domini"]; }
List<String> erasShort() #
Returns abbreviations of the era names.
List<String> erasShort() { return ["BC", "AD"]; }
int firstDayOfTheWeek() #
Returns the day which generally comes first in a weekly calendar view, as an index into the return value of {@link #weekdaysFull()}.
int firstDayOfTheWeek() { return 1; }
String formatDay() #
Returns localized format equivalent to the "d" skeleton pattern.
String formatDay() { return "d"; }
String formatHour12Minute() #
Returns localized format equivalent to the "hm" skeleton pattern.
String formatHour12Minute() { return "h:mm a"; }
String formatHour12MinuteSecond() #
Returns localized format equivalent to the "hms" skeleton pattern.
String formatHour12MinuteSecond() { return "h:mm:ss a"; }
String formatHour24Minute() #
Returns localized format equivalent to the "Hm" skeleton pattern.
String formatHour24Minute() { return "HH:mm"; }
String formatHour24MinuteSecond() #
Returns localized format equivalent to the "Hms" skeleton pattern.
String formatHour24MinuteSecond() { return "HH:mm:ss"; }
String formatMinuteSecond() #
Returns localized format equivalent to the "ms" skeleton pattern.
String formatMinuteSecond() { return "mm:ss"; }
String formatMonthAbbrev() #
Returns localized format equivalent to the "MMM" skeleton pattern.
String formatMonthAbbrev() { return "LLL"; }
String formatMonthAbbrevDay() #
Returns localized format equivalent to the "MMMd" skeleton pattern.
String formatMonthAbbrevDay() { return "MMM d"; }
String formatMonthFull() #
Returns localized format equivalent to the "MMMM" skeleton pattern.
String formatMonthFull() { return "LLLL"; }
String formatMonthFullDay() #
Returns localized format equivalent to the "MMMMd" skeleton pattern.
String formatMonthFullDay() { return "MMMM d"; }
String formatMonthFullWeekdayDay() #
Returns localized format equivalent to the "MMMMEEEEd" skeleton pattern.
String formatMonthFullWeekdayDay() { return "EEEE MMMM d"; }
String formatMonthNumDay() #
Returns localized format equivalent to the "Md" skeleton pattern.
String formatMonthNumDay() { return "M-d"; }
String formatYear() #
Returns localized format equivalent to the "y" skeleton pattern.
String formatYear() { return "y"; }
String formatYearMonthAbbrev() #
Returns localized format equivalent to the "yMMM" skeleton pattern.
String formatYearMonthAbbrev() { return "y MMM"; }
String formatYearMonthAbbrevDay() #
Returns localized format equivalent to the "yMMMd" skeleton pattern.
String formatYearMonthAbbrevDay() { return "y MMM d"; }
String formatYearMonthFull() #
Returns localized format equivalent to the "yMMMM" skeleton pattern.
String formatYearMonthFull() { return "y MMMM"; }
String formatYearMonthFullDay() #
Returns localized format equivalent to the "yMMMMd" skeleton pattern.
String formatYearMonthFullDay() { return "y MMMM d"; }
String formatYearMonthNum() #
Returns localized format equivalent to the "yM" skeleton pattern.
String formatYearMonthNum() { return "y-M"; }
String formatYearMonthNumDay() #
Returns localized format equivalent to the "yMd" skeleton pattern.
String formatYearMonthNumDay() { return "y-M-d"; }
String formatYearMonthWeekdayDay() #
Returns localized format equivalent to the "yMMMEEEd" skeleton pattern.
String formatYearMonthWeekdayDay() { return "EEE, y MMM d"; }
String formatYearQuarterFull() #
Returns localized format equivalent to the "yQQQQ" skeleton pattern.
String formatYearQuarterFull() { return "y QQQQ"; }
String formatYearQuarterShort() #
Returns localized format equivalent to the "yQ" skeleton pattern.
String formatYearQuarterShort() { return "y Q"; }
List<String> monthsFull() #
Returns an array of full month names.
List<String> monthsFull() { return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; }
List<String> monthsFullStandalone() #
Returns an array of month names for use in a stand-alone context.
List<String> monthsFullStandalone() { return monthsFull(); }
List<String> monthsNarrow() #
Returns an array of the shortest abbreviations for months, typically a single character and not guaranteed to be unique.
List<String> monthsNarrow() { return ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D" ]; }
List<String> monthsNarrowStandalone() #
Returns an array of the shortest abbreviations for months suitable for use in a stand-alone context, typically a single character and not guaranteed to be unique.
List<String> monthsNarrowStandalone() { return monthsNarrow(); }
List<String> monthsShort() #
Returns an array of month abbreviations.
List<String> monthsShort() { return [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; }
List<String> monthsShortStandalone() #
Returns an array of month abbreviations, suitable for use in a stand-alone context.
List<String> monthsShortStandalone() { return monthsShort(); }
List<String> quartersFull() #
Returns an array of full quarter names.
List<String> quartersFull() { return [ "1st quarter", "2nd quarter", "3rd quarter", "4th quarter" ]; }
List<String> quartersShort() #
Returns an array of abbreviations for quarters.
List<String> quartersShort() { return [ "Q1", "Q2", "Q3", "Q4" ]; }
String timeFormat() #
Returns a safe default time format.
String timeFormat() { return timeFormatMedium(); }
String timeFormatFull() #
Returns a "full" time format.
String timeFormatFull() { return "HH:mm:ss zzzz"; }
String timeFormatLong() #
Returns a "long" time format.
String timeFormatLong() { return "HH:mm:ss z"; }
String timeFormatMedium() #
Returns a "medium" time format.
String timeFormatMedium() { return "HH:mm:ss"; }
String timeFormatShort() #
Returns a "short" time format.
String timeFormatShort() { return "HH:mm"; }
List<String> weekdaysFull() #
Returns an array of the full names of weekdays.
List<String> weekdaysFull() { return [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]; }
List<String> weekdaysFullStandalone() #
Returns an array of the full names of weekdays, suitable for use in a stand-alone context.
List<String> weekdaysFullStandalone() { return weekdaysFull(); }
List<String> weekdaysNarrow() #
Returns an array of the shortest abbreviations for weekdays, typically a single character and not guaranteed to be unique.
List<String> weekdaysNarrow() { return [ "S", "M", "T", "W", "T", "F", "S" ]; }
List<String> weekdaysNarrowStandalone() #
Returns an array of the shortest abbreviations for weekdays suitable for use in a stand-alone context, typically a single character and not guaranteed to be unique.
List<String> weekdaysNarrowStandalone() { return weekdaysNarrow(); }
List<String> weekdaysShort() #
Returns an array of abbreviations for weekdays.
List<String> weekdaysShort() { return [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; }
List<String> weekdaysShortStandalone() #
Returns an array of abbreviations for weekdays, suitable for use in a stand-alone context.
List<String> weekdaysShortStandalone() { return weekdaysShort(); }
int weekendEnd() #
Returns the day which ends the weekend, as an index into the return value of {@link #weekdaysFull()}.
Note that this value may be numerically less than {@link #weekendStart()} - for example, {@link #weekendStart()} of 6 and {@link #weekendEnd()} of 0 means Saturday and Sunday are the weekend.
int weekendEnd() { return 0; }
int weekendStart() #
Returns the day which starts the weekend, as an index into the return value of {@link #weekdaysFull()}.
int weekendStart() { return 6; }