Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
angular-timezone-selector
Advanced tools
A simple AngularJS directive to create timezone select. It uses chosen to create auto-complete timezone select. Timezone information comes from moment. Countries timezone data comes from TimezoneDB.
The user is able to choose their timezone by either typing the name of their country, or the name of the timezone directly.
The angular model that is bound to this directive will be set to the timezone name as used by moment-timezone i.e Pacific/Auckland
.
If you have a feature or fix please submit a pull request! This repo follows JavaScript standard style, please make sure all pull requests comply to this before submitting them.
Install using bower
bower install angular-timezone-selector
Make your Angular module depend on module angular-timezone-selector
.
angular.module('timezoneSelectExample', ['angular-timezone-selector']);
Then use directive timezone-selector
.
<timezone-selector ng-model="timezone">
Options can be included as attributes in the html element.
moment.tz.names;
.An example of using the options is below:
<timezone-selector
ng-model="timezone"
display-utc="true"
sort-by="offset"
show-local="true"
set-local="true"
primary-choices="UTC GB WET GMT Asia/Macau"
width="400px"
></timezone-selector>
The screenshot below show angular-selector in action with all options enabled:
An example of using a custom placeholder message:
<div ng-init="translations.placeholder = 'SeLecT your timezone :)'">
<timezone-selector
ng-model="result"
translations="translations"
display-utc="true"
sort-by="offset"
show-local="true"
primary-choices="UTC GB WET GMT Asia/Macau"
name="timezone"
required>
</timezone-selector>
</div>
or with translate:
<div ng-init="translations.placeholder = ('TIMEZONE_PLACEHOLDER' | translate)">
<timezone-selector
ng-model="result"
translations="translations"
display-utc="true"
sort-by="offset"
show-local="true"
primary-choices="UTC GB WET GMT Asia/Macau"
name="timezone"
required>
</timezone-selector>
</div>
M Clark for adding options for primary & local timezones, and the ability to show and sort by offset.
a-k-g for fixing syntax error in data file and reminding me to update the bower tags!
Tom Grooffer for fixing a crash with JSTZ
karlhaas for fixing a crash when two instances were present on the same page and adding injectable strings and translations
G-Lex for adding the ability to set the width when creating the directive
Gu1 for making sure that moment was properly injected
tiagotex for adding the ability to set the local timezone as default, and fixing a bug where primary timezones with spaces wouldn't work
Rémy Dufour for adding Montreal as a timezone
Akiko Takano for adding more translation support
Inspired by angular-timezone-select from alexcheng1982.
Styled using the examples from bootstrap-chosen by alxlit
FAQs
AngularJS timezone selector
The npm package angular-timezone-selector receives a total of 65 weekly downloads. As such, angular-timezone-selector popularity was classified as not popular.
We found that angular-timezone-selector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.