1.1.3 • Published 3 years ago
tyhme v1.1.3
Tyhme
A time manipulation package.
- Add and subtract days, hours, years, etc. to a date.
- Format date to just about anything like MM/DD/YY, MM-DD-YYY, etc.
- Get time from and time to a certain date, it could return "yesterday", "a year ago", "last year".
Installation
npm install --save tyhme
Quick Start
const Tyhme = require('tyhme');
const tyhme = new Tyhme();
Methods
Format
tyhme.format('MM/DD/YYYY'); // returns current date in that format. exp: 12/12/2021
Time Ago
tyhme.timeAgo(); // returns just now.
Add
tyhme.add(12, 'days'); // adds 12 days to current date.
Subtract
tyhme.subtract(10, 'days'); // subtracts 10 days to current date.