2.2.0 • Published 4 months ago

@sineverba/years-interval v2.2.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 months ago

Years Interval

CI / CDStatus
NPMnpm version
Semaphore CIBuild Status
Circle CICircleCI
CoverallCoverage Status
SonarCloudQuality Gate Status

years interval returns current year or a string made by a year start + current year.

Useful to use in copyright section ("Copyright 2018-2020 by Acme INC").

"2018-2020" in previous example is what you get.

Installation

npm install @sineverba/years-interval

Usage

(In following examples current year is assumed as 2020)

import { GetYearInterval } from '@sineverba/years-interval';

const yearInterval = GetYearInterval("2020");
console.log(yearInterval); // returns 2020
const newYearInterval = GetYearInterval("2018");
console.log(newYearInterval); // returns 2018-2020
// on next year...
console.log(yearInterval); // returns 2020-2021
console.log(newYearInterval); // returns 2018-2021

Tests

npm run test for simple test

npm run cover for coverage

2.2.0

4 months ago

2.1.0

10 months ago

2.0.0

1 year ago

1.4.0

1 year ago

1.3.0

2 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.1

4 years ago