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
- Host: GitHub
- URL: https://github.com/alexcheng1982/angular-timezone-select
- Owner: alexcheng1982
- License: mit
- Created: 2015-01-07T11:31:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T22:18:25.000Z (over 8 years ago)
- Last Synced: 2025-09-11T09:03:58.548Z (9 months ago)
- Topics: angularjs, javascript, timezone, timezone-select
- Language: HTML
- Homepage: http://alexcheng1982.github.io/angular-timezone-select/
- Size: 3.39 MB
- Stars: 2
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```