Skip to content

Commit 034a3a1

Browse files
Updated readme
1 parent 26677d8 commit 034a3a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ console.log(timelydiff(timestamp2)); // "4 months ago"
3434
```
3535

3636
> To generate a timestamp at the current moment and store it for later use, you can use the built-in JavaScript function Date.now(), which returns the number of milliseconds since January 1, 1970, 00:00:00 UTC (Unix timestamp).
37-
3837
<br>
38+
3939
Optionally, you can pass a second parameter to the function to specify the length of the output string. By default, the function will return a string in the format of x [unit] ago/in [x] [unit], but you can choose to return a shorter string by setting the length parameter to "short" or "shorter".
4040

4141
```javascript
@@ -45,8 +45,8 @@ console.log(timeDiffShort); // "4mo ago"
4545

4646
//timelydiff(timestamp, "shorter") -> 4mo
4747
```
48-
4948
<br>
49+
5050
### API
5151
**`timelydiff(timestamp, length)`**
5252
Converts a Unix timestamp into a human-readable time difference.
@@ -57,11 +57,11 @@ Parameters
5757

5858
Returns
5959
A string representing the time difference between the current time and the given timestamp.
60-
6160
<br>
61+
6262
### Contribution
6363
Contributions are welcome and appreciated! If you have an idea for an improvement or a bug fix, please feel free to open an issue or submit a pull request. Before submitting a pull request, please ensure that your code follows the existing code style and has been thoroughly tested. Thank you for helping to make TimelyDiff even better!
64-
6564
<br>
65+
6666
### License
6767
TimelyDiff is released under the **[MIT License](https://opensource.org/license/mit/)**.

0 commit comments

Comments
 (0)