date-names
Repository of localized month and day names. Usable in Node.js or in the browser.
Installation
Install via npm:
% npm install date-names
Usage
The default locale is en
(English). Thus, a require('date-names')
implicitly does require('date-names/en')
.
var names = ; namesmonths // => ['January', 'February', 'March', ...]namesabbreviated_months // => ['Jan', 'Feb', 'Mar', 'Apr', ...] namesdays // => ['Sunday', 'Monday', 'Tuesday', ...]namesabbreviated_days // => ['Sun', 'Mon', 'Tue', 'Wed', ...] namesam // => 'AM'namespm // => 'PM'
You can fetch a different translation by requiring a specific locale:
var names = ; namesmonths // => ['Januar', 'Februar', 'März', ...]namesabbreviated_months // => ['Jan', 'Feb', 'Mär', 'Apr', ...] namesdays // => ['Sonntag', 'Montag', 'Dienstag', ...]namesabbreviated_days // => ['So', 'Mo', 'Di', 'Mi', ...] namesam // => 'vormittags'namespm // => 'nachmittags'
Brazilian Portuguese (pt-br), Czech (cs), Danish (da), Dutch (nl), English (en), Finnish (fi), French (fr), German (de), Spanish (es), Russian (ru), Slovak (sk), Swedish (sv) and Turkish (tr) are currently the only supported locales. Pull requests welcome.
Contributing
Here's a quick guide:
- Fork the repo and
make install
. - Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate:
make test
. - Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or are fixing a bug, we need a test!
- Make the test pass.
- Push to your fork and submit a pull request.
Licence
Released under The MIT License.