lib/rubyvis/format/date.rb in rubyvis-0.1.1 vs lib/rubyvis/format/date.rb in rubyvis-0.1.2

- old
+ new

@@ -8,11 +8,18 @@ #@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) - ::Date.strptime(s, pattern) + time=::DateTime.strptime(s, pattern) + Time.utc(time.year, time.month, time.day, time.hour, time.min, time.sec, 0) end end end -end \ No newline at end of file +end