Permalink
Browse files

Merge pull request #7 from bradseefeld/master

Fix JS Date format
  • Loading branch information...
2 parents 67426e7 + 91666b6 commit 4f44053c6a1d1616d5e1c116d4ecf41f237349c5 Ary Borenszweig committed Mar 19, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/rgviz_rails/executor.rb
View
6 lib/rgviz_rails/executor.rb
@@ -368,7 +368,8 @@ def value.as_json(options = {})
self
end
def value.encode_json(*)
- "new Date(#{strftime('%Y,%d,%m')})"
+ month = strftime("%m").to_i - 1
+ "new Date(#{strftime('%Y,' + month.to_s + ',%d')})"
end
value
when :datetime
@@ -377,7 +378,8 @@ def value.as_json(*)
self
end
def value.encode_json(*)
- "new Date(#{strftime('%Y,%d,%m,%H,%M,%S')})"
+ month = strftime("%m").to_i - 1
+ "new Date(#{strftime('%Y,' + month.to_s + ',%d,%H,%M,%S')})"
end
value
when :timeofday

0 comments on commit 4f44053

Please sign in to comment.