Class ExtraDateStrings


  • public class ExtraDateStrings
    extends java.lang.Object
    ExtraDateStrings, This class holds extra date strings. This includes: # Formats for parsing dates in a particular language. # Overridden month names for particular locales. All the fields and functions are static.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] monthsNamesForLanguage_ru
      monthsNamesForLanguage_ru, This is a constant list of "standalone" month names, for the Russian locale.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String[] getDefaultStandaloneLongMonthNamesForLocale​(java.util.Locale locale)
      getDefaultStandaloneLongMonthNamesForLocale, This will return a list of capitalized, translated, standalone month names for the specified locale.
      static java.lang.String[] getDefaultStandaloneShortMonthNamesForLocale​(java.util.Locale locale)  
      static java.util.ArrayList<java.time.format.DateTimeFormatter> getExtraParsingFormatsForLocale​(java.util.Locale locale)
      getExtraParsingFormatsForLocale, This will return a list of extra parsing formatters for the specified locale.
      static java.lang.String[] getFormattingMonthNamesArray​(java.util.Locale locale, boolean capitalize, boolean shortVersion)
      getFormattingMonthNamesArray, This returns an array with the translated, formatting version of the month names for the specified locale.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • monthsNamesForLanguage_ru

        public static final java.lang.String[] monthsNamesForLanguage_ru
        monthsNamesForLanguage_ru, This is a constant list of "standalone" month names, for the Russian locale. This was previously used to supply the Russian month names, but now that this class has a generalized solution for getting the standalone month names in all languages, this array should only be used for visual reference. This can be used for comparison to ensure that the general solution is functioning correctly.
    • Constructor Detail

      • ExtraDateStrings

        public ExtraDateStrings()
    • Method Detail

      • getExtraParsingFormatsForLocale

        public static java.util.ArrayList<java.time.format.DateTimeFormatter> getExtraParsingFormatsForLocale​(java.util.Locale locale)
        getExtraParsingFormatsForLocale, This will return a list of extra parsing formatters for the specified locale. If no extra formatters are found, then this will return an empty list. (This will never return null.)
      • getDefaultStandaloneLongMonthNamesForLocale

        public static java.lang.String[] getDefaultStandaloneLongMonthNamesForLocale​(java.util.Locale locale)
        getDefaultStandaloneLongMonthNamesForLocale, This will return a list of capitalized, translated, standalone month names for the specified locale. This function will always return a list with 12 elements, and each element will always contain a string. This will never return a null array, or any null elements. Implementation note: it was previously required to override the month names in certain languages such as Russian, to get the proper grammar. At this point, a generalized solution has been implemented for all languages. It is assumed that this solution is working correctly, unless and until someone reports that it is not working correctly for their language.
      • getDefaultStandaloneShortMonthNamesForLocale

        public static java.lang.String[] getDefaultStandaloneShortMonthNamesForLocale​(java.util.Locale locale)
      • getFormattingMonthNamesArray

        public static java.lang.String[] getFormattingMonthNamesArray​(java.util.Locale locale,
                                                                      boolean capitalize,
                                                                      boolean shortVersion)
        getFormattingMonthNamesArray, This returns an array with the translated, formatting version of the month names for the specified locale. (The "formatting version" of the month names can be different from the standalone version in some locales, including Russian and Czech. The formatting version would be used in a formatted date, and the standalone version would be used if the month is being specified by itself.) capitalize: This specifies whether the month name should be capitalized or not capitalized. shortVersion: This specifies whether the month names should be the short, or long versions of the formatting month names.