src/render.js
function () {
    var tzGuess = moment.tz.guess() || 'UTC';
    setCustomerTimezone(tzGuess);

    // Add the guessed customer timezone to list if its unknwon
    var knownTimezone = $.grep(timezones, function (tz) {
      return tz.key === customerTimezone
    }).length > 0
    if (!knownTimezone) {
      var name = '(' + moment().tz(customerTimezone).format('Z') + ') ' + customerTimezone
      timezones.unshift({
        key: customerTimezone,
        name: name
      });
    }
  }
function () {
    var tzGuess = moment.tz.guess() || 'UTC';
    setCustomerTimezone(tzGuess);

    // Add the guessed customer timezone to list if its unknwon
    var knownTimezone = $.grep(timezones, function (tz) {
      return tz.key === customerTimezone
    }).length > 0
    if (!knownTimezone) {
      var name = '(' + moment().tz(customerTimezone).format('Z') + ') ' + customerTimezone
      timezones.unshift({
        key: customerTimezone,
        name: name
      });
    }
  }
function ( ) { var tzGuess = moment . tz . guess ( ) || 'UTC' ; setCustomerTimezone ( tzGuess ) ; // Add the guessed customer timezone to list if its unknwon var knownTimezone = $ . grep ( timezones , function ( tz ) { return tz . key === customerTimezone } ) . length > 0 if ( ! knownTimezone ) { var name = '(' + moment ( ) . tz ( customerTimezone ) . format ( 'Z' ) + ') ' + customerTimezone timezones . unshift ( { key : customerTimezone , name : name } ) ; } }
Guess the timezone and set global variable
Guess the timezone and set global variable