我正在尝试使用timeago
( source ), with datejs
,但它不起作用。这是我希望工作的一些示例代码(假设timeago
并datejs
已加载):
>>> d = new Date()
Mon Jun 21 2010 13:24:37 GMT-0400 (EST) { _orient=1, more...}
>>> d.toISOString() // datejs.toISOString
"2010-06-21T17:24:37.501Z" // this is a valid ISO8601 string, I believe
>>> $.timeago(d.toISOString()) // this should work
"NaN years ago"
对于为什么这可能会失败,以及如何解决或规避这个问题,我非常有义务提供任何意见。
谢谢你。
布赖恩