0.1.3 • Published 7 years ago

timezonelist-js v0.1.3

Weekly downloads
23
License
ISC
Repository
github
Last release
7 years ago

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' }
0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago