Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuangls committed May 4, 2018
1 parent 5a6df39 commit a8d267d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
## API
### fromNow(date, [options])
```js
// 用于计算从现在到过去或未来日期的可读时间差
// 用于计算从过去到现在或未来日期的可读时间差
date: timestamp or FormatDateTime
return: "1秒以前,1分钟以前,1小时以前,1天以前 ..."

fromNow('2018/01/01');
// 2018/01/01 => new Date()

forNow('2018/01/01', '2018/01/02')
// 2018/01/01 => 2018/01/02

return: "1秒以前,1分钟以前,1小时以前,1天以前 ..."
```

0 comments on commit a8d267d

Please sign in to comment.