Skip to content

Another dateOnly option implementation, plus a minor ISO8601 parsing improvement #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Next Next commit
Made parsing account for timezone offsets that have no minute compone…
…nt (which is valid under ISO8601)
  • Loading branch information
cameron314 committed Dec 29, 2011
commit ee56583373ce0fd336d08d93379540ac6513284b
4 changes: 3 additions & 1 deletion jquery.timeago.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
var hours = minutes / 60;
var days = hours / 24;
var years = days / 365;



function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number;
Expand All @@ -90,6 +91,7 @@
s = s.replace(/\.\d\d\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/");
s = s.replace(/T/," ").replace(/Z/," UTC");
s = s.replace(/([\+\-]\d\d)$/,"$1:00"); // -04 -> -04:00
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
return new Date(s);
},
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy