Sha256: 7d82f959e894ca1448da5cbb510cdba8f165e751c2aa497e0eab5f655455d7e7
Contents?: true
Size: 532 Bytes
Versions: 24
Compression:
Stored size: 532 Bytes
Contents
require 'date' module Rubyvis module Format class Date attr_reader :pattern def initialize(pattern) @pattern=pattern #@pad=Rubyvis::Format.pad end def format(d) d.strftime(pattern) end def format_lambda pat=pattern lambda {|d| d.strftime(pat) } end def parse(s) time=::DateTime.strptime(s, pattern) Time.utc(time.year, time.month, time.day, time.hour, time.min, time.sec, 0) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems