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-0.11.12 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.11 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.10 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.9 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.8 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.7 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.6 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.5 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.4 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.3 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.2 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.1 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.11.0 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.17 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.16 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.15 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.14 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.13 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.12 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee
effective_bootstrap-0.10.11 app/assets/javascripts/effective_time_zone_select/initialize.js.coffee