Socket
Socket
Sign inDemoInstall

timezonelist-js

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    timezonelist-js

List of time zones you can use for your dropdown forms.


Version published
Weekly downloads
13
Maintainers
1
Install size
15.3 kB
Created
Weekly downloads
 

Readme

Source

Timezone List

=== List of time zones you can use for your dropdown forms.

alt text

Installation

$ npm install timezonelist-js

Usage

var tzlist = // require('timezonelist-js') assuming tzlist in used on the backend and passed as javascript object to front-end
var select = document.getElementById("timezone") //get your <select></select> element

for (var i = 0; i < tzlist.length; i++) {
	var timezone = tzlist[i]
	select.options[i] = new Option(timezone.text, timezone.value)
}

Custom text


var text = timezone.place + ' (UTC' + timezone.time + ')'
select.options[i] = new Option(text, timezone.value)

Output


{ id: 'Pacific/Midway', value: '(UTC-11:00) Midway Island', place: 'Midway Island', time: '-11:00' }

Keywords

FAQs

Last updated on 20 Nov 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc