https://github.com/mihailgaberov/select-year-with-offset
A small, simple package that gives you a certain number of years to be displayed in a html select box with an option for offset, i.e. if you need to display only the years up unitl now minus 'X' (e.g. give the user opportunity to register only if he has more than 18 years).
https://github.com/mihailgaberov/select-year-with-offset
npm package select year
Last synced: 7 months ago
JSON representation
A small, simple package that gives you a certain number of years to be displayed in a html select box with an option for offset, i.e. if you need to display only the years up unitl now minus 'X' (e.g. give the user opportunity to register only if he has more than 18 years).
- Host: GitHub
- URL: https://github.com/mihailgaberov/select-year-with-offset
- Owner: mihailgaberov
- License: mit
- Created: 2017-05-31T10:18:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-30T08:55:16.000Z (over 8 years ago)
- Last Synced: 2025-01-18T00:49:01.084Z (9 months ago)
- Topics: npm, package, select, year
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# select-year-with-offset
A small, simple npm package that gives you a certain number of years to be displayed in an html select box with an option for offset, i.e. if you need to display only the years up until now minus 'X' (e.g. give the user opportunity to register only if he has more than 18 years).## Install
npm i --save-dev select-year-with-offset## Usage
Import the package in your project:
import { getYears } from 'select-year-with-offset'const years = getYears(18, 100)
// This will give you the years from 1999
till 1899 (if we are still in 2017 :)## Copyrights
Mihail Gaberov, © 2017
[mihail-gaberov.eu](http://mihail-gaberov.eu)