ensure-date-fns-supports-locale
v1.0.0
Published
Ensure that date-fns supports passed locale
Downloads
18
Readme
ensure-date-fns-supports-locale
Library helps you to be sure that passed locale(s) supported by date-fns library
Install
npm install ensure-date-fns-supports-locale --save
or
yarn add ensure-date-fns-supports-locale
Usage
const ensureLocale = require('ensure-date-fns-supports-locale');
// check single locale
const ensureIsRussianSupported = ensureLocale('ru'); // true
const ensureIsElvenSupported = ensureLocale('elv'); // false
// check array of locales
const ensureLocalesSupported = ensureLocale(['ru', 'en', 'eo']); // true
const ensureLocalesSupported = ensureLocale(['zzz', 'en', 'eo']); // false
Tests
npm test