Package org.jruby.util
Class RubyDateFormatter
java.lang.Object
org.jruby.util.RubyDateFormatter
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ByteListprivate static final ByteListprivate static final ByteListstatic RubyDateFormatter.Tokenprivate RubyDateFormatter.Token[]private intprivate static final RubyDateFormatter.Token[]static RubyDateFormatter.Tokenstatic RubyDateFormatter.Tokenprivate static final String[]private static final String[]private static final String[]private static final String[]private final StrftimeLexerprivate org.jcodings.Encodingprivate static final ByteListprivate final Rubystatic RubyDateFormatter.Token -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToken(RubyDateFormatter.Token token) private voidaddToPattern(String str) compileAndFormat(RubyString pattern, boolean dateLibrary, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis) Convenience method when using no pattern cachingvoidcompilePattern(RubyString format, boolean dateLibrary) voidcompilePattern(ByteList pattern, boolean dateLibrary) format(RubyDateFormatter.Token[] compiledPattern, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis) private static voidformatSubMillisGt3(Ruby runtime, ByteList buff, int width, RubyNumeric sub_millis) private ByteListformatToByteList(RubyDateFormatter.Token[] compiledPattern, org.joda.time.DateTime dt, long nsec, RubyNumeric sub_millis) private static intformatWeekYear(org.joda.time.DateTime dt, int firstDayOfWeek) private static ByteListformatZone(int colons, int value, RubyTimeOutputFormatter formatter) private voidparse(String source, ParsePosition pos) private static intyear(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)
-
Field Details
-
AM
-
PM
-
CAPITAL_AM
-
CAPITAL_PM
-
FORMAT_MONTHS
-
FORMAT_SHORT_MONTHS
-
FORMAT_WEEKDAYS
-
FORMAT_SHORT_WEEKDAYS
-
CONVERSION2TOKEN
-
runtime
-
lexer
-
COLON_TOKEN
-
DASH_TOKEN
-
DOT_TOKEN
-
SLASH_TOKEN
-
compiledPattern
-
compiledPatternLength
private int compiledPatternLength -
patternEncoding
private org.jcodings.Encoding patternEncoding
-
-
Constructor Details
-
RubyDateFormatter
Constructor for RubyDateFormatter.
-
-
Method Details
-
addToPattern
-
compilePattern
-
addToken
-
growTokens
private void growTokens() -
compilePattern
-
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
-
parse
- See Also:
-