Periodo
A library for parsing and generating a convenient string representation of a time period.
Get Started
Install with: npm i periodo
In your code:
const periodo = ; // Get milliseconds from string representation.var p = ;console;
Suported time units are:
- y Years
- m Months
- w Weeks
- d Days
- h Hours
- mn Minutes
- s Seconds
- ms Milliseconds
const periodo = ; // Get string representation from millisecondsvar p1 = ;console; // Works with negativesvar p2 = ;console; // Define precision time unitvar p3 = ;console; // Get difference between two datesvar p4 = periodo;console; // Increase a date by a given periodvar d1 = periodo;console; // Decrease a date by a given periodvar d2 = periodo;console;
Reporting Bugs
If you have found any problems with this module, please:
- Open an issue.
- Describe what happened and how.
- Also in the issue text, reference the label
~bug
.
We will make sure to take a look when time allows us.
Proposing Features
If you wish to get that awesome feature or have some advice for us, please:
- Open an issue.
- Describe your ideas.
- Also in the issue text, reference the label
~proposal
.
Contributing
If you have spotted any enhancements to be made and is willing to get your hands dirty about it, fork us and submit your merge request so we can collaborate effectively.