Class RubyDateFormatter

java.lang.Object
org.jruby.util.RubyDateFormatter

public class RubyDateFormatter extends Object
  • Field Details

    • AM

      private static final ByteList AM
    • PM

      private static final ByteList PM
    • CAPITAL_AM

      private static final ByteList CAPITAL_AM
    • CAPITAL_PM

      private static final ByteList CAPITAL_PM
    • FORMAT_MONTHS

      private static final String[] FORMAT_MONTHS
    • FORMAT_SHORT_MONTHS

      private static final String[] FORMAT_SHORT_MONTHS
    • FORMAT_WEEKDAYS

      private static final String[] FORMAT_WEEKDAYS
    • FORMAT_SHORT_WEEKDAYS

      private static final String[] FORMAT_SHORT_WEEKDAYS
    • CONVERSION2TOKEN

      private static final RubyDateFormatter.Token[] CONVERSION2TOKEN
    • runtime

      private final Ruby runtime
    • lexer

      private final StrftimeLexer lexer
    • COLON_TOKEN

      public static RubyDateFormatter.Token COLON_TOKEN
    • DASH_TOKEN

      public static RubyDateFormatter.Token DASH_TOKEN
    • DOT_TOKEN

      public static RubyDateFormatter.Token DOT_TOKEN
    • SLASH_TOKEN

      public static RubyDateFormatter.Token SLASH_TOKEN
    • compiledPattern

      private RubyDateFormatter.Token[] compiledPattern
    • compiledPatternLength

      private int compiledPatternLength
    • patternEncoding

      private org.jcodings.Encoding patternEncoding
  • Constructor Details

    • RubyDateFormatter

      public RubyDateFormatter(ThreadContext context)
      Constructor for RubyDateFormatter.
  • Method Details

    • addToPattern

      private void addToPattern(String str)
    • compilePattern

      public void compilePattern(RubyString format, boolean dateLibrary)
    • addToken

      private void addToken(RubyDateFormatter.Token token)
    • growTokens

      private void growTokens()
    • compilePattern

      public void compilePattern(ByteList pattern, boolean dateLibrary)
    • compileAndFormat

      public RubyString compileAndFormat(RubyString pattern, boolean dateLibrary, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis)
      Convenience method when using no pattern caching
    • format

      public RubyString format(RubyDateFormatter.Token[] compiledPattern, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis)
    • formatToByteList

      private ByteList formatToByteList(RubyDateFormatter.Token[] compiledPattern, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis)
    • formatSubMillisGt3

      private static void formatSubMillisGt3(Ruby runtime, ByteList buff, int width, RubyNumeric sub_millis)
    • year

      private static int year(org.joda.time.DateTime dt, int year)
      Ruby always follows Astronomical year numbering, that is BC x is -x+1 and there is a year 0 (BC 1) but Joda-time returns -x for year x BC in Julian chronology (no year 0)
    • formatWeekYear

      private static int formatWeekYear(org.joda.time.DateTime dt, int firstDayOfWeek)
    • formatZone

      private static ByteList formatZone(int colons, int value, RubyTimeOutputFormatter formatter)
    • parse

      public Date parse(String source, ParsePosition pos)
      See Also: