fix for micro second precision timestamps

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.
This commit is contained in:
Maximillian Dornseif 2010-08-29 17:32:46 +08:00 committed by Ryan McGeary
parent 925b5e7041
commit 05abe2b454

View file

@ -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