k-dates
v1.0.2
Published
npm package for formatting date and time
Downloads
1
Readme
k-dates
npm package for formatting date and time, support multi languange (indonesian & english)
Supported languange
- English ("en")
- Indonesian ("id")
How To Use
Import the function
const kDate = require('k-dates');
return current date with format "YYYY-MM-DD"
console.log(kDate.today("YYYY-MM-DD"));
return current full month name with format "DD-MMMM-YYYY in spesific languange'
// <english (default)>
console.log(kDate.today("DD-MMMM-YYYY"));
// <indonesian>
console.log(kDate.today("DD-MMMM-YYYY","id"));
return current full day name with format "DDDD, DD-MM-YYYY in spesific languange'
// <english (default)>
console.log(kDate.today("DDDD, DD-MM-YYYY"));
// <indonesian>
console.log(kDate.today("DDDD, DD-MM-YYYY","id"));
return full month name only
// <english (default)>
console.log(kDate.fullMonth(1)); // Will return 'January'
// <indonesia>
console.log(kDate.fullMonth(1),"id"); // Will return 'Januari'
Supported date format
- YYYY-MM-DD (2020-12-25).
- DD-MM-YYYY (25-12-2020).
- DD-MMM-YYYY (25-Dec-2020).
- DD-MMMM-YYYY (25-December-2020).
- MM-DD-YYYY (12-25-2020).
- DDD, DD-MM-YYYY (Fri, 25-12-2020).
- DDDD, DD-MM-YYYY (Friday, 25-12-2020).
- DDD, DD-MMM-YYYY (Fri, 25-Dec-2020).
- DDD, DD-MMMM-YYYY (Fri, 25-December-2020).
- DDDD, DD-MMM-YYYY (Fri, 25-Dec-2020).
- DDDD, DD-MMMM-YYYY (Friday, 25-December-2020).