Top Fields Constructors Methods
org.jruby.ext.date

pack-priv abstract Class DateUtils

extends Object
Class Inheritance
Imports
org.jruby.*, org.jruby.runtime.JavaSites, .ThreadContext, org.jruby.runtime.builtin.IRubyObject

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private static final int
private static final int
private static final int
private static final int
pack-priv static final int
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Long
_valid_civil_p(int y, int m, int d, final long sg)

pack-priv static Long
_valid_commercial_p(int y, int w, int d, final long sg)

pack-priv static Long
_valid_nth_kday_p(int y, int m, int n, int k, final long sg)

pack-priv static Long
_valid_ordinal_p(int y, int d, final long sg)

pack-priv static Long
_valid_weeknum_p(int y, int w, int d, int f, final long sg)

pack-priv static long

Returns:

the corresponding Julian Day Number
civil_to_jd
(int y, int m, int d, double
specifies the Day of Calendar Reform
sg
)

Convert a Civil Date to a Julian Day Number.

pack-priv static long
commercial_to_jd(int y, int w, int d, final long sg)

# Convert a Commercial Date to a Julian Day Number.

pack-priv static IRubyObject
pack-priv static int
decode_year(ThreadContext context, IRubyObject y, final int style, RubyInteger[] nth)

pack-priv static Long
find_fdom(int y, int m, final long sg)

pack-priv static Long
find_fdoy(int y, final long sg)

pack-priv static Long
find_ldom(int y, int m, final long sg)

pack-priv static Long
find_ldoy(int y, final long sg)

pack-priv static long
guess_style(ThreadContext context, IRubyObject y, double sg)

pack-priv static int[]

Returns:

the corresponding [year, month, day_of_month] as a three-element array.
jd_to_civil
(long jd, double
specifies the Day of Calendar Reform
sg
)

Convert a Julian Day Number to a Civil Date.

pack-priv static int[]
jd_to_commercial(long jd, final long sg)

# Convert a Julian Day Number to a Commercial Date # # +jd+ is the Julian Day Number to convert.

private static int[]
jd_to_nth_kday(long jd, final long sg)

pack-priv static int[]
jd_to_ordinal(long jd, final double sg)

Convert a Julian Day Number to an Ordinal Date.

private static int[]
jd_to_weeknum(long jd, int f, final long sg)

private static long
nth_kday_to_jd(int y, int m, int n, int k, final long sg)

pack-priv static int
pack-priv static long
ordinal_to_jd(int y, int d, final long sg)

Convert an Ordinal Date to a Julian Day Number.

private static JavaSites.DateSites
pack-priv static boolean
valid_time_p(long h, long min, long s)

private static long
weeknum_to_jd(int y, int w, int d, int f, final long sg)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CM_PERIODback to summary
pack-priv static final int CM_PERIOD
CM_PERIOD0back to summary
private static final int CM_PERIOD0
CM_PERIOD_GCYback to summary
private static final int CM_PERIOD_GCY
CM_PERIOD_JCYback to summary
private static final int CM_PERIOD_JCY
GC_PERIOD0back to summary
private static final int GC_PERIOD0
INVALID_OFFSETback to summary
pack-priv static final int INVALID_OFFSET
JC_PERIOD0back to summary
private static final int JC_PERIOD0

Constructor Detail

DateUtilsback to summary
pack-priv DateUtils()

Method Detail

_valid_civil_pback to summary
pack-priv static Long _valid_civil_p(int y, int m, int d, final long sg)
_valid_commercial_pback to summary
pack-priv static Long _valid_commercial_p(int y, int w, int d, final long sg)
_valid_nth_kday_pback to summary
pack-priv static Long _valid_nth_kday_p(int y, int m, int n, int k, final long sg)
_valid_ordinal_pback to summary
pack-priv static Long _valid_ordinal_p(int y, int d, final long sg)
_valid_weeknum_pback to summary
pack-priv static Long _valid_weeknum_p(int y, int w, int d, int f, final long sg)
civil_to_jdback to summary
pack-priv static long civil_to_jd(int y, int m, int d, double sg)

Convert a Civil Date to a Julian Day Number. +y+, +m+, and +d+ are the year, month, and day of the month.

Parameters
sg:double

specifies the Day of Calendar Reform

Returns:long

the corresponding Julian Day Number

commercial_to_jdback to summary
pack-priv static long commercial_to_jd(int y, int w, int d, final long sg)

# Convert a Commercial Date to a Julian Day Number. # # +y+, +w+, and +d+ are the (commercial) year, week of the year, # and day of the week of the Commercial Date to convert. # +sg+ specifies the Day of Calendar Reform.

day_to_secback to summary
pack-priv static IRubyObject day_to_sec(ThreadContext context, IRubyObject d)
decode_yearback to summary
pack-priv static int decode_year(ThreadContext context, IRubyObject y, final int style, RubyInteger[] nth)
find_fdomback to summary
pack-priv static Long find_fdom(int y, int m, final long sg)
find_fdoyback to summary
pack-priv static Long find_fdoy(int y, final long sg)
find_ldomback to summary
pack-priv static Long find_ldom(int y, int m, final long sg)
find_ldoyback to summary
pack-priv static Long find_ldoy(int y, final long sg)
guess_styleback to summary
pack-priv static long guess_style(ThreadContext context, IRubyObject y, double sg)
jd_to_civilback to summary
pack-priv static int[] jd_to_civil(long jd, double sg)

Convert a Julian Day Number to a Civil Date. +jd+ is the Julian Day Number. +sg+ specifies the Day of Calendar Reform.

Parameters
sg:double

specifies the Day of Calendar Reform

Returns:int[]

the corresponding [year, month, day_of_month] as a three-element array.

jd_to_commercialback to summary
pack-priv static int[] jd_to_commercial(long jd, final long sg)

# Convert a Julian Day Number to a Commercial Date # # +jd+ is the Julian Day Number to convert. # +sg+ specifies the Day of Calendar Reform. # # Returns the corresponding Commercial Date as # [commercial_year, week_of_year, day_of_week]

jd_to_nth_kdayback to summary
private static int[] jd_to_nth_kday(long jd, final long sg)
jd_to_ordinalback to summary
pack-priv static int[] jd_to_ordinal(long jd, final double sg)

Convert a Julian Day Number to an Ordinal Date. +jd+ is the Julian Day Number to convert. +sg+ specifies the Day of Calendar Reform. Returns the corresponding Ordinal Date as [year, day_of_year]

jd_to_weeknumback to summary
private static int[] jd_to_weeknum(long jd, int f, final long sg)
nth_kday_to_jdback to summary
private static long nth_kday_to_jd(int y, int m, int n, int k, final long sg)
offset_to_secback to summary
pack-priv static int offset_to_sec(ThreadContext context, IRubyObject of)
ordinal_to_jdback to summary
pack-priv static long ordinal_to_jd(int y, int d, final long sg)

Convert an Ordinal Date to a Julian Day Number. +y+ and +d+ are the year and day-of-year to convert. +sg+ specifies the Day of Calendar Reform. Returns the corresponding Julian Day Number.

sitesback to summary
private static JavaSites.DateSites sites(ThreadContext context)
valid_time_pback to summary
pack-priv static boolean valid_time_p(long h, long min, long s)
weeknum_to_jdback to summary
private static long weeknum_to_jd(int y, int w, int d, int f, final long sg)