Class: Date

Inherits:
Object show all
Defined in:
lib/core_ext/date.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(string) ⇒ Object



6
7
8
9
# File 'lib/core_ext/date.rb', line 6

def self.json_create string
  return nil if string.nil?
  Date.parse(string)
end

Instance Method Details

#to_json(*a) ⇒ Object



2
3
4
# File 'lib/core_ext/date.rb', line 2

def to_json(*a)
  %("#{strftime("%Y/%m/%d")}")
end