我正在努力timeago与之合作datejs (with help of this to get format for local time)
因为timeago我使用以下内容:
jQuery(document).ready(function() {
jQuery("abbr.timeago").timeago();
});
Run Code Online (Sandbox Code Playgroud)
对于localtime我使用这个:
jQuery(document).ready(function() {
$('.UTCTimestamp').localTimeFromUTC('MM/dd/yyyy hh:mm:ss');
});
Run Code Online (Sandbox Code Playgroud)
我如何将这两者结合在一起?现在我只能像这样使用一个:
对于Timeago:
<span class='UTCTimestamp'>2011-09-09 10:10:10</span>
Run Code Online (Sandbox Code Playgroud)
并为当地时间;
<abbr class='timeago' title='2011-09-09 10:10:10'>2011-09-09 10:10:10</abbr>
Run Code Online (Sandbox Code Playgroud)