Adding Date#xmlschema from ActiveSupport for Ruby < 1.9. Closes #47
This commit is contained in:
parent
150ff1e5e4
commit
09946386b1
|
@ -19,4 +19,12 @@ class Hash
|
||||||
|
|
||||||
target
|
target
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Thanks, ActiveSupport!
|
||||||
|
class Date
|
||||||
|
# Converts datetime to an appropriate format for use in XML
|
||||||
|
def xmlschema
|
||||||
|
strftime("%Y-%m-%dT%H:%M:%S%Z")
|
||||||
|
end if RUBY_VERSION < '1.9'
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue