2.0.7 • Published 4 years ago

graphql-timezone v2.0.7

Weekly downloads
80
License
ISC
Repository
github
Last release
4 years ago

GraphQL Timezone

Timezone scalar type for GraphQL.js.

Ex: Europe/Prague

Usage

This package exports a Timezone scalar GraphQL.js type and list of available timezones as array of strings and as enum as well:

import timezoneScalar, { timezones, Timezone } from 'graphql-timezone';

// Generate Timezone scalar
const Timezone = timezoneScalar();

// Generate Timezone with custom name and custom description
const CustomTimezone = timezoneScalar({
  name: 'CustomTimezone',
  description: 'Description of Custom Timezone scalar.'
});

// Get list of avaliable timezones
const listOfAvailableTimezones: string[] = timezones;

// Use Enum of generated timezones
const newTimezone = Timezone.EuropePrague // Points to "Europe/Prague"

Dependency

To list and validate the timezone, this library uses MomentTimezone.

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago