Adding Date#xmlschema from ActiveSupport for Ruby < 1.9. Closes #47

This commit is contained in:
Nick Quaranto 2009-06-23 18:22:27 -04:00
parent 150ff1e5e4
commit 09946386b1
1 changed files with 9 additions and 1 deletions

View File

@ -19,4 +19,12 @@ class Hash
target
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