Class: javajava::util::Date
Constant Summary
collapse
- FULL_STYLE =
java::text::DateFormat::FULL
- LONG_STYLE =
java::text::DateFormat::LONG
- MEDIUM_STYLE =
java::text::DateFormat::MEDIUM
- SHORT_STYLE =
java::text::DateFormat::SHORT
- DEFAULT_STYLE =
java::text::DateFormat::DEFAULT
- STYLE =
{
:full => FULL_STYLE,
:long => LONG_STYLE,
:medium => MEDIUM_STYLE,
:short => SHORT_STYLE,
:default => DEFAULT_STYLE
}
JactiveSupport::JavaExtensions::Date::Conversions::DATE_FORMATS
JactiveSupport::JavaExtensions::Date::Calculations::CALCULATION_FIELDS
Class Method Summary
collapse
Instance Method Summary
collapse
#format, #formatter, #httpdate, included, #pattern_formatter, #to_date, #to_datetime, #to_formatted_s, #to_java_sqldate, #to_time
#advance, #age, #difference
Class Method Details
.date_instance(date_style = :default, locale = nil) ⇒ Object
34
35
36
|
# File 'lib/jactive_support/java_ext/date.rb', line 34
def self.date_instance(date_style=:default, locale=nil)
java::text::DateFormat.getDateInstance(STYLE[date_style], locale.to_locale)
end
|
.date_time_instance(date_style = :default, time_style = :default, locale = nil) ⇒ Object
26
27
28
|
# File 'lib/jactive_support/java_ext/date.rb', line 26
def self.date_time_instance(date_style=:default, time_style=:default, locale=nil)
java::text::DateFormat.getDateTimeInstance(STYLE[date_style], STYLE[time_style], locale.to_locale)
end
|
.time_instance(time_style = :default, locale = nil) ⇒ Object
30
31
32
|
# File 'lib/jactive_support/java_ext/date.rb', line 30
def self.time_instance(time_style=:default, locale=nil)
java::text::DateFormat.getTimeInstance(STYLE[time_style], locale.to_locale)
end
|
Instance Method Details
#acts_like_time? ⇒ Boolean
22
23
24
|
# File 'lib/jactive_support/java_ext/date.rb', line 22
def acts_like_time?
true
end
|
#to_java_date ⇒ Object
17
18
19
|
# File 'lib/jactive_support/core_ext/to_java_date.rb', line 17
def to_java_date
self
end
|