date-names-ex
Repository of localized month and day names. Usable for sites, have minified version and separate minified locale files.
Installation
Install via npm:
% npm install date-names-ex
Usage
Add script to you webpage
Now to get locale you can use date_names
variable.
var en_date_locale = date_namesen; en_date_localemonths // => ['January', 'February', 'March', ...]en_date_localeabbreviated_months // => ['Jan', 'Feb', 'Mar', 'Apr', ...] en_date_localedays // => ['Sunday', 'Monday', 'Tuesday', ...]en_date_localeabbreviated_days // => ['Sun', 'Mon', 'Tue', 'Wed', ...] en_date_localeam // => 'AM'en_date_localepm // => 'PM'
You can fetch a different translation like that:
var de_date_locale = date_namesde; de_date_localemonths // => ['Januar', 'Februar', 'März', ...]de_date_localeabbreviated_months // => ['Jan', 'Feb', 'Mär', 'Apr', ...] de_date_localedays // => ['Sonntag', 'Montag', 'Dienstag', ...]de_date_localeabbreviated_days // => ['So', 'Mo', 'Di', 'Mi', ...] de_date_localeam // => 'vormittags'de_date_localepm // => 'nachmittags'
If you need only Ru
locale, for example, you can use just this local file like that:
Adn then use it like that:
date_names_rumonths // => ['Январь', 'Февраль', 'Март', ...]date_names_ruabbreviated_months // => ['Янв', 'Фев', 'Мар', 'Апр', ...] date_names_rudays // => ['Воскресенье', 'Понедельник', 'Вторник', ...]date_names_ruabbreviated_days // => ['Вс', 'Пн', 'Вт', 'Ср', ...] date_names_ruam // => 'до полудня'date_names_rupm // => 'после полудня'
English (en), German (de), Finnish (fi), Brazilian Portuguese (pt-br), Russian (ru) and Spanish (es) are currently the only supported locales. Pull requests welcome.
Contributing
Here's a quick guide:
-
Fork the repo
-
npm install
-
grunt
-
Make you changes and add test for you functionality if you add new language. Look into
/test
folder. -
Check that all test passed by running
grunt
-
Push to your fork and submit a pull request.
Licence
Released under Mozilla Public License Version 2.0