Sha256: f48ab9e899706f318d055f6e7ac8586262ed0d5a43f7726944346c907b5b2735
Contents?: true
Size: 462 Bytes
Versions: 1
Compression:
Stored size: 462 Bytes
Contents
module Tabs module Resolutions module Month extend Tabs::Resolutionable extend self PATTERN = "%Y-%m" def serialize(timestamp) timestamp.strftime(PATTERN) end def deserialize(str) dt = DateTime.strptime(str, PATTERN) self.normalize(dt) end def from_seconds(s) s / 1728000 end def normalize(ts) Time.utc(ts.year, ts.month) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tabs-0.9.0 | lib/tabs/resolutions/month.rb |