简体   繁体   中英

jQuery timeago plugin not working in Safari

I am using jQuery timeago plugin, and it is working in Chrome and Firefox but not in Safari. The usage is pretty simple as given on the website.

 $(document).ready(function() {
      jQuery("abbr.timeago").timeago();
    });

<abbr class="timeago" title="{{ISO8601_TIME timeStamp}}">{{COMMENT_DATE_TIME timeStamp}}</abbr>

The title and the date in the <abbr> tags is the iso timestamp. It works as expected in Chrome and Firefox but simply prints out the timestamp in Safari (eg 2012-11-28 19:16:49).

Can anyone please help me out where the problem is?

EDIT In Chrome: 在此处输入图片说明

In Safari: 在此处输入图片说明

for utc string created from: newDate.toUTCString():

in Google Chrome browser, calling jQuery.timeago('Fri, 31 May 2013 10:37:16 GMT') produce output 'NaN years ago'. However, it is working fine in Firefox browse.

The best is to use newDate.toISOString() and it works in both browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM