Class PreJava9DateFormatProvider


  • public class PreJava9DateFormatProvider
    extends java.lang.Object
    Provides DateFormats for US locale with patterns which were the default ones before Java 9.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String getDateFormatPattern​(int style)  
      private static java.lang.String getDatePartOfDateTimePattern​(int dateStyle)  
      private static java.lang.String getTimePartOfDateTimePattern​(int timeStyle)  
      static java.text.DateFormat getUSDateFormat​(int style)
      Returns the same DateFormat as DateFormat.getDateInstance(style, Locale.US) in Java 8 or below.
      static java.text.DateFormat getUSDateTimeFormat​(int dateStyle, int timeStyle)
      Returns the same DateFormat as DateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US) in Java 8 or below.
      • Methods inherited from class java.lang.Object

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

      • PreJava9DateFormatProvider

        public PreJava9DateFormatProvider()
    • Method Detail

      • getUSDateFormat

        public static java.text.DateFormat getUSDateFormat​(int style)
        Returns the same DateFormat as DateFormat.getDateInstance(style, Locale.US) in Java 8 or below.
      • getUSDateTimeFormat

        public static java.text.DateFormat getUSDateTimeFormat​(int dateStyle,
                                                               int timeStyle)
        Returns the same DateFormat as DateFormat.getDateTimeInstance(dateStyle, timeStyle, Locale.US) in Java 8 or below.
      • getDateFormatPattern

        private static java.lang.String getDateFormatPattern​(int style)
      • getDatePartOfDateTimePattern

        private static java.lang.String getDatePartOfDateTimePattern​(int dateStyle)
      • getTimePartOfDateTimePattern

        private static java.lang.String getTimePartOfDateTimePattern​(int timeStyle)