@sineverba/rangedates
v1.2.0
Published
rangedates returns an object starting from one or two dates
Downloads
14
Readme
| CI / CD | Status | | ------- | ------ | | NPM | | | Semaphore CI | | | Circle CI | | | Coverall | | | SonarCloud | |
rangedates
returns an object starting from one or two dates.
Installation
npm install @sineverba/rangedates
Usage
| Props | Required | Default | | ----- | -------- | ------- | | dateStart | N | today | | dateEnd | N | today | | outputFormat | N | "YYYY-MM-DD" |
import { rangedates } from "@sineverba/rangedates";
const dateStart = "01/01/2024";
const dateEnd = "30/01/2024";
const outputFormat = "YYYY-MM-DD";
const result = rangedates(dateStart, dateEnd, outputFormat);
console.log(result);
It returns
{
startDate: "2024-01-01",
endDate: "2024-01-30"
}
Tests
npm run test
for simple test
npm run coverage
for coverage