Skip to content

Commit

Permalink
Merge pull request #12 from retraigo/dev
Browse files Browse the repository at this point in the history
fix: remove condition for time
  • Loading branch information
retraigo authored Mar 16, 2022
2 parents 21b73c7 + 245d808 commit 8b2cbaa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,6 @@ new Duration(245074).array;
*/
```


## Support
Join our Discord server [here](https://discord.gg/Ess9VJKYEZ)
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Duration {
* @returns {<Duration>}
*/
constructor(timestamp = Duration.getCurrentDuration()) {
if (timestamp < 1) timestamp = 0; // Prevent negative time
if (timestamp < 0) timestamp = 0; // Prevent negative time
this.raw = timestamp;
this.d = Math.trunc(timestamp / 86400000);
this.h = Math.trunc(timestamp / 3600000) % 24;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@retraigo/duration.js",
"version": "2.3.0",
"version": "2.3.1",
"type": "module",
"description": "Get the formatted time duration",
"main": "index.js",
Expand Down

0 comments on commit 8b2cbaa

Please sign in to comment.