sykros-date-utility

1.0.0 • Public • Published

SETUP:

    let _ = dateUtilities({
    datePeriod: 5,
    logger: "common logger",
    debug: true,
    pluginPeriod: false
})

OPTION PARAMETERS:

  • required:
    • datePeriod: to add specific day to date then compare with the present
    • logger: plug in your logger
    • debug: enable debug mode
    • utcMode: convert the present time to start or end of this day
    • pluginPeriod: enable pluginPeriod to compare

Sample usage

//time.now() is 2022-08-10
let isExpired: boolean;
//return false
isExpired = _.DisablePlugin().IsExpired(new Date("2022-12-11"));

isExpired = _.DisablePlugin().IsExpired(new Date("2022-04-10")); //return true time.now() > 2022-04-10   
/**
 * Set date period to 5 this mean add 5 days to date parameter
 */
isExpired = _.EnablePlugin().SetDatePeriod(5).IsExpired(new Date("2022-04-10")); // return false time.now() < 2022-09-10   

Readme

Keywords

none

Package Sidebar

Install

npm i sykros-date-utility

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

11.3 kB

Total Files

5

Last publish

Collaborators

  • sykros2k