better json time format

This commit is contained in:
Chris Anderson 2008-09-10 14:37:30 -07:00
parent 1197b6c1fa
commit a2a78dcf5f

View file

@ -8,4 +8,12 @@ require File.dirname(__FILE__) + '/pager'
require File.dirname(__FILE__) + '/file_manager'
require File.dirname(__FILE__) + '/streamer'
# this has to come after the JSON gem
# this date format sorts lexicographically
# and is compatible with Javascript's new Date(time_string) constructor
class Time
def to_json(options = nil)
%("#{strftime("%Y/%m/%d %H:%M:%S %z")}")
end
end