Class: Date

Inherits:
Object show all
Defined in:
lib/qooxview/additions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_db(d) ⇒ Object



135
136
137
# File 'lib/qooxview/additions.rb', line 135

def self.from_db(d)
  (d.class == String) ? Date.strptime(d, '%Y-%m-%d') : d
end

.from_web(d) ⇒ Object



131
132
133
# File 'lib/qooxview/additions.rb', line 131

def self.from_web(d)
  Date.strptime(d, '%d.%m.%Y')
end

Instance Method Details

#to_webObject



127
128
129
# File 'lib/qooxview/additions.rb', line 127

def to_web
  strftime('%d.%m.%Y')
end