An open API service indexing awesome lists of open source software.

https://github.com/alexcheng1982/angular-timezone-select

Timezone select for AngularJS
https://github.com/alexcheng1982/angular-timezone-select

angularjs javascript timezone timezone-select

Last synced: 9 months ago
JSON representation

Timezone select for AngularJS

Awesome Lists containing this project

README

          

# Timezone select for AngularJS

__Note__ Only supports up to AngularJS `1.5.x`, see [this issue](https://github.com/alexcheng1982/angular-timezone-select/issues/14).

A simple AngularJS directive to create timezone select. It uses [select2](http://select2.github.io/select2/) to create auto-complete timezone select. Timezone information comes from [moment](http://momentjs.com/timezone/). Countries timezone data comes from [TimezoneDB](http://timezonedb.com/download).

In the dropdown, timezones are divided into three groups:
* __UTC__ - UTC is a common option for most users.
* __Common__ - Timezones for a country
* __Other__ - Other timezones

If the user has already selected the country, timezones for the country will be listed first, which makes easier for user to select.

## Install

Install `angular-timezone-select` using Bower `bower install angular-timezone-select`.

## Usage

Make your Angular module depend on module `angular-timezone-select`.

```javascript
angular.module('timezoneSelectExample', ['angular-timezone-select']);
```

Then use directive `timezone-select`.

```html

```

Attribute `country` can be used to bind user's selected country. Value of selected country should be the [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code, e.g. `CN`, `US`.

See `example.html` for a simple example.

## Translations

You can provide different Translations for timezone groups. See table below.

|Attribute|Default value|
|----|----|
|i18n-utc|UTC|
|i18n-common|Common|
|i18n-other|Other|

For example,

```html

```