jvidalv-easy-european-date
v1.0.2
Published
Generate european format date from a Date object.
Downloads
5
Maintainers
Readme
jvidalv-easy-european-date
Generate european format date from a Date object.
- Import jvidalv-easy-european-date package
- The function returns an string
- Function easyEurpeanDate requires a date Object as first parameter
- As a second paramter (Optional) you can customize separator between date and time, passing and object.
- This object accepts timeSeparator (string, defaults /), dateSeparator (stirng, defaults :) and showHoursAndMinutes (bool, defaults false)
Examples
var foo = require("jvidalv-easy-european-date")
// Example 1 without second parameter
var date = new Date()
console.log(foo(date))
// log -> 24/06/2019
// Example 2 with second parameter
var date = new Date()
console.log(foo(date, {dateSeparator: '-', timeSeparator: ':', showHoursAndMinutes : true}))
// log -> 24-06-2019 22:24
Check more utilities packages
- https://www.npmjs.com/~jvidalv
- https://www.npmjs.com/package/jvidalv-easy-european-date