better json time format
This commit is contained in:
parent
1197b6c1fa
commit
a2a78dcf5f
1 changed files with 8 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue