     working_group = $('#task_working_group_id :selected').text()
     escaped_wg = working_group.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1')
     options = $(organizers).filter("optgroup[label='#{escaped_wg}']").html()
-    console.log options
     if options
       $('#task_organizer_id').html(options)
       $('#task_organizer_id').parent().show()

      dayOfWeekStart: I18n.t('datepicker.day_of_week_start'),
      format:         I18n.t('datepicker.date_format'),
      minDate:        0,
      scrollMonth:    false
    });

    $('.xd_timepicker').datetimepicker({
      datepicker:     false,
      step:           15,
      format:         I18n.t('datepicker.time_format'),
      defaultTime:    '12:00'
    });

  showOrHideEndDate = ->
    type = $('#task_scheduling_type').val()
    if type == "between" 
      $('.at-element').hide()

class Lale.DateTime
  constructor: (date_field, time_field)->
    @value = this.buildDate(date_field, time_field)

  buildDate: (date_field, time_field)->
    date = this.parseDate(date_field)
    time = this.parseTime(time_field)
    date.setHours(time['hours'])
    date.setMinutes(time['minutes'])
    date

  valid:->
    @value instanceof Date

  parseDate: (field)->
    field.datetimepicker('getValue')

  parseTime: (field)->
    if field.val()
      parts = field.val().split(":")
      h = parseInt(parts[0])
      m = parseInt(parts[1])
    else
      h = 0
      m = 0
    { hours: h, minutes: m }

ready = ->

