public class RubyDateFormatter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
RubyDateFormatter.FieldType |
(package private) static class |
RubyDateFormatter.Format |
static class |
RubyDateFormatter.Token |
| Modifier and Type | Field and Description |
|---|---|
private ThreadContext |
context |
private static RubyDateFormatter.Token[] |
CONVERSION2TOKEN |
private static java.text.DateFormatSymbols |
FORMAT_SYMBOLS |
(package private) static RubyDateFormatter.Format |
INSTANTIATE_ENUM |
private StrftimeLexer |
lexer |
| Constructor and Description |
|---|
RubyDateFormatter(ThreadContext context)
Constructor for RubyDateFormatter.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addToPattern(java.util.List<RubyDateFormatter.Token> compiledPattern,
java.lang.String str) |
RubyString |
compileAndFormat(RubyString pattern,
boolean dateLibrary,
org.joda.time.DateTime dt,
long nsec,
IRubyObject sub_millis)
Convenience method when using no pattern caching
|
java.util.List<RubyDateFormatter.Token> |
compilePattern(RubyString format,
boolean dateLibrary) |
RubyString |
format(java.util.List<RubyDateFormatter.Token> compiledPattern,
org.joda.time.DateTime dt,
long nsec,
IRubyObject sub_millis) |
private int |
formatWeekYear(org.joda.time.DateTime dt,
int firstDayOfWeek) |
private java.lang.String |
formatZone(int colons,
int value,
RubyTimeOutputFormatter formatter) |
static void |
main(java.lang.String[] args) |
java.util.Date |
parse(java.lang.String source,
java.text.ParsePosition pos) |
private 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)
|
private static final java.text.DateFormatSymbols FORMAT_SYMBOLS
private static final RubyDateFormatter.Token[] CONVERSION2TOKEN
private ThreadContext context
private StrftimeLexer lexer
static final RubyDateFormatter.Format INSTANTIATE_ENUM
public RubyDateFormatter(ThreadContext context)
public static void main(java.lang.String[] args)
private void addToPattern(java.util.List<RubyDateFormatter.Token> compiledPattern, java.lang.String str)
public java.util.List<RubyDateFormatter.Token> compilePattern(RubyString format, boolean dateLibrary)
public RubyString compileAndFormat(RubyString pattern, boolean dateLibrary, org.joda.time.DateTime dt, long nsec, IRubyObject sub_millis)
public RubyString format(java.util.List<RubyDateFormatter.Token> compiledPattern, org.joda.time.DateTime dt, long nsec, IRubyObject sub_millis)
private int year(org.joda.time.DateTime dt,
int year)
private int formatWeekYear(org.joda.time.DateTime dt,
int firstDayOfWeek)
private java.lang.String formatZone(int colons,
int value,
RubyTimeOutputFormatter formatter)
public java.util.Date parse(java.lang.String source,
java.text.ParsePosition pos)
DateFormat.parse(String, ParsePosition)