Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lightFormat function and optimize toDate
- Loading branch information
1 parent
9290f41
commit deca669
Showing
12 changed files
with
1,506 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function addLeadingZeros(number, targetLength) { | ||
var sign = number < 0 ? '-' : '' | ||
var output = Math.abs(number).toString() | ||
while (output.length < targetLength) { | ||
output = '0' + output | ||
} | ||
return sign + output | ||
} |
Oops, something went wrong.