Acme.BookStore.HttpApi.Host/node_modules/timeago/README.markdown
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
# timeago: a jQuery plugin
[](https://www.npmjs.com/package/timeago)
[](http://bower.io/search/?q=jquery-timeago)
Timeago is a jQuery plugin that makes it easy to support automatically updating
fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago") from ISO 8601
formatted dates and times embedded in your HTML (à la microformats).
---
**How You Can Help**
[][square]
[][paypal]
[][codementor]
If you like this project, [buy me a coffee][paypal], or [book a session with me][codementor], or donate bitcoin: `1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m`
[square]: https://cash.me/$rmm5t/5 "Donate to rmm5t for open source!"
[paypal]: https://www.paypal.me/rmm5t/5 "Donate to rmm5t for open source!"
[bitcoin]: bitcoin:1rmm5tv6f997JK5bLcGbRCZyVjZUPkQ2m?amount=0.01&label=Coffee%20to%20rmm5t%20for%20Open%20Source "Buy rmm5t a coffee for open source!"
[codementor]: https://www.codementor.io/rmm5t?utm_campaign=profile&utm_source=button-rmm5t&utm_medium=shields "Book a session with rmm5t on Codementor!"
[](https://twitter.com/rmm5t)
[](http://stackoverflow.com/users/8985/ryan-mcgeary)
## Usage
First, load jQuery and the plugin:
```html
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.timeago.js" type="text/javascript"></script>
```
Now, let's attach it to your timestamps on DOM ready - put this in the head
section:
```html
<script type="text/javascript">
jQuery(document).ready(function() {
$("time.timeago").timeago();
});
</script>
```
This will turn all `<time>` elements with a class of `timeago` and a
`datetime` attribute formatted according to the
[ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) standard:
```html
<time class="timeago" datetime="2011-12-17T09:24:17Z">December 17, 2011</time>
```
into something like this:
```html
<time class="timeago" datetime="2011-12-17T09:24:17Z" title="December 17, 2011">about 1 day ago</time>
```
后面还有 72 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
