Search code examples
jquerydatetimetimepicker

Can't set automatically TimeZone in TimePicker


Using TimePiker I want to set timezone:

$('#timeStart').timepicker({
                showTimezone: true,
                timeFormat: "hh:mm TT",
                timezoneList: 
              [
                { 'value': '-720', 'label': '(GMT-12:00) International Date Line West' },
                { 'value': '-660', 'label': '(GMT-11:00) Midway Island, Samoa' }
                   ....
                { 'value': '+840', 'label': '(GMT+14:00) Time in Samoa' }
              ]
        });

timepiker is initialized and zones is added in selector but selected value is the first from list is not detected if I set manually option timezone: '+840' it work

why timezone is not detect automatically?


Solution

  • I found solution,instead of

    { 'value': '-720', 'label': '(GMT-12:00) International Date Line West' }
    

    Is need to use

    { value: -720, label: '(GMT-12:00) International Date Line West' }