Timeago 插件无法在 JavaScript 中运行
我有一个 标记,其类为
details italic
,并且 title
属性设置为最近时间,时间戳为2011-02-08 10:42:04
。我该如何调用 timeago 插件才能获取 2 小时前
的值?
I have an <abbr>
tag which has the class as details italic
and the title
property is set as the recent time with time stamp as 2011-02-08 10:42:04
. How am i suppose to call the timeago plugin in order to get the value as 2 hours ago
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
说明对于时间戳格式非常特殊,它需要采用ISO 8601:
仅仅
2011-02-08 10:42:04
可能不行。The instructions are pretty particular on the timestamp format, it needs to be in ISO 8601:
Just
2011-02-08 10:42:04
probably won't do.我认为 文档 确实很好地解释了这一点。您是否尝试过但无法正常工作?
将在所有
abbr
元素(带有details italic
类)上调用timeago
并根据title< 中设置的日期更改其值/代码> 属性。
I think the documentation does explain this pretty well. Did you try it and couldn't get it working?
Will call
timeago
on allabbr
elements (with classesdetails italic
) and change their value according to the date set in thetitle
attribute.