Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Add support for converting Time and Date to Toml
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Sep 13, 2016
1 parent 5b2cd53 commit afe15be
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/dato/dump/format/toml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
require 'active_support/core_ext/hash/keys'
require 'toml'

class Time
def to_toml(path = "")
utc.strftime("%Y-%m-%dT%H:%M:%SZ")
end
end

class Date
def to_toml(path = "")
strftime("%Y-%m-%d")
end
end

module Dato
module Dump
module Format
Expand Down

0 comments on commit afe15be

Please sign in to comment.