Sha256: b17774e4930f82d22673f1c78137ea92acc1a143fc32fcd7b0e2af2b5bbeb131
Contents?: true
Size: 372 Bytes
Versions: 11
Compression:
Stored size: 372 Bytes
Contents
class Date def to_json(*a) %("#{to_s(:json)}") end def to_s_with_json(*args) if args[0] == :json strftime("%Y/%m/%d") else to_s_without_json *args end end alias_method :to_s_without_json, :to_s alias_method :to_s, :to_s_with_json def self.json_create string return nil if string.nil? Date.parse(string) end end
Version data entries
11 entries across 11 versions & 2 rubygems