Sha256: b8e828f7274fcc24d91cb3f400566038a6643e4e5c6353946ebc337384dc7aeb

Contents?: true

Size: 512 Bytes

Versions: 250

Compression:

Stored size: 512 Bytes

Contents

(this.EffectiveBootstrap || {}).effective_time_zone_select = ($element, options) ->
  unless $element.val().length > 0
    try
      offset = moment().format('Z')

      zones = $element.find('option').filter -> $(this).text().includes(offset)
      zone = zones.find (obj) -> $(obj).text().includes('Time') # Favor Mountain Time (US & Canada) over Arizona

      guess = if zone.length > 0 then zone else zones.first()

      $element.val(guess.val()) if guess.length > 0

  $select = $element.select2(options)

Version data entries

250 entries across 250 versions & 1 rubygems

Version Path
effective_bootstrap-1.19.10 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.9 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.8 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.7 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.6 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.5 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.4 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.3 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.2 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.1 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.19.0 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.7 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.4 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.3 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.2 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.1 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.18.0 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.17.6 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.17.5 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-1.17.4 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee