Module: Arcade::Support::Date

Defined in:
lib/support/conversions.rb

Instance Method Summary collapse

Instance Method Details

#to_dbObject



146
147
148
149
150
151
152
# File 'lib/support/conversions.rb', line 146

def to_db
  if RUBY_PLATFORM == 'java'
    java.util.Date.new( year-1900, month-1, day , 0, 0 , 0 )  ## Jahr 0 => 1900
  else
    self
  end
end

#to_orObject



153
154
155
156
157
# File 'lib/support/conversions.rb', line 153

def to_or
  "\"#{self.to_s}\""
# "DATE(\'#{self.to_s}\',\'yyyy-MM-dd\')"
#  "DATE(#{self.strftime('%Q')})"
end