Skip to content

Commit

Permalink
fix for micro second precision timestamps
Browse files Browse the repository at this point in the history
timeago is now able to parse timestamps wth micro-second precision.
Before timestamps like "2010-08-29 09:24:52.556066Z" resutled in an
parsing error / invalid datetime object.
  • Loading branch information
Maximillian Dornseif authored and rmm5t committed Aug 30, 2010
1 parent 925b5e7 commit 05abe2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jquery.timeago.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
parse: function(iso8601) {
var s = $.trim(iso8601);
s = s.replace(/\.\d\d\d/,""); // remove milliseconds
s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/");
s = s.replace(/T/," ").replace(/Z/," UTC");
s = s.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
Expand Down

0 comments on commit 05abe2b

Please sign in to comment.