jquery timeago NaN years ago with ISO date format

安稳与你 提交于 2019-12-13 07:40:23

问题


I have some issues with jQuery timeago plugin http://timeago.yarp.com/

First of all, the short call version doesn't works, I don't know why. $("#abbr.timeago").timeago(); displays nothing. I must use $("abbr.timeago").text($.timeago($(this).prop("title"))); Weird...

(called in $(document).ready...)

Anyway, timeago allways displays me a 'NaN years ago'. Here are some generated html tag with differents formats

"yyyy-MM-dd'T'HH:mm:ss'Z'"
<abbr class="timeago" title="2013-04-17T11:32:08Z">NaN years ago</abbr>

...HH:mm:ssZ" displays
<abbr class="timeago" title="2013-04-17T11:32:08+0100">NaN years ago</abbr>

"...HH:mm:ssZ" displays
<abbr class="timeago" title="2013-04-17T11:32:08CEST">NaN years ago</abbr>

"...HH:mm:ss" displays
<abbr class="timeago" title="2013-04-17T11:32:08">NaN years ago</abbr>

Can anyone tell what format should I use ? and, is the <abbr> tag required ?

Jquery 1.10.2, timeago 1.1.0, chrome 26

Thanks !

来源:https://stackoverflow.com/questions/16057822/jquery-timeago-nan-years-ago-with-iso-date-format

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!