5.0.1 • Published 7 months ago

joi-tz v5.0.1

Weekly downloads
843
License
Apache-2.0
Repository
github
Last release
7 months ago

joi-tz - Joi Timezone Validation

npm version License: MIT CircleCI Coverage Status Known Vulnerabilities FOSSA Status

Provides a Joi rule to validate IANA timezone strings (eg. Europe/London, America/New_York, Etc/GMT-8) using luxon.

Joi-tz supports and is tested against Joi 16.x or higher.

This project is forked from joi-timezone (unmaintained). That project remains functional for Joi 9.x-15.x.

Installation:

npm: npm install joi-tz

yarn: yarn add joi-tz

Usage

import BaseJoi from 'joi';
import JoiTimezone from 'joi-tz';

const Joi = BaseJoi.extend(JoiTimezone);

Joi.timezone().validate('Australia/Darwin');
// returns {value: 'Australia/Darwin'}

Compatibility

This library is tested for compatibility, and contains peer dependencies with the following versions.

Version@hapi/joi 16.xjoi 16.xjoi 17.xTimezone Database
5.0.1Luxon 3.5.x
5.0.0Luxon 3.4.x
4.1.1Moment-Timezone 0.5.x
4.1.0Moment-Timezone 0.5.x
4.0.2Moment-Timezone 0.5.x

License

FOSSA Status

5.0.1

7 months ago

5.0.0

1 year ago

4.1.1

3 years ago

4.1.0

4 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago