lib/tabs/resolutions/day.rb in tabs-0.9.1 vs lib/tabs/resolutions/day.rb in tabs-1.0.0
- old
+ new
@@ -1,13 +1,17 @@
module Tabs
module Resolutions
module Day
- extend Resolutionable
+ include Tabs::Resolutionable
extend self
PATTERN = "%Y-%m-%d"
+ def name
+ :day
+ end
+
def serialize(timestamp)
timestamp.strftime(PATTERN)
end
def deserialize(str)
@@ -15,9 +19,13 @@
self.normalize(dt)
end
def from_seconds(s)
s / 1.day
+ end
+
+ def to_seconds
+ 1.day
end
def add(ts, num)
ts + num.days
end