1.0.4 • Published 5 years ago

@pkopy/dateformat v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

#@pkopy/dateformat

xxx

Install

$ npm install @pkopy/dateformat

Usage

const dateToFormat = require("@pkopy/datefomat")

const myDate = new dateToFormat.MyDate()

const x = myDate.dateFormat(new Date('2001-04-01'), 'dmy', '*')

console.log(x)

//=> 01*04*2020

myDate.addDay(10, 'dmy', '-')

Methods

dateFormat(date,separator)

  • date (optional) is a Date object, if date is null a default is a today date
  • format (optional) is a format a data (string)
    • 'ymd' - year, month, day
    • can use any combination of this three characters
    • if empty a default value is 'mdy'
  • separator (optional) string - if empty a default value is '/'

addDay(number,separator) - adds x days to today date

  • number is a positive or negative number
  • format (optional) is a format a data (string)
    • 'ymd' - year, month, day
    • can use any combination of this three characters
    • if empty a default value is 'mdy'
  • separator (optional) string - if empty a default value is '/'
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago