lib/wice/helpers/js_calendar_helpers.rb
# A struct containing all data for rendering a calendar
A struct containing all data for rendering a calendar
A struct containing all data for rendering a calendar
def prepare_data_for_calendar(options)  
      date_format = Wice::ConfigurationProvider.value_for(:DATE_FORMAT)
      CalendarData.new.tap do |calendar_data|
        calendar_data.name                      = options[:name]
        calendar_data.date_string               = options[:initial_date].nil? ? '' : options[:initial_date].strftime(date_format)
        calendar_data.dom_id                    = options[:name].gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '').gsub(/\./, '_').gsub(/_+/, '_')
        calendar_data.datepicker_placeholder_id = calendar_data.dom_id + '_date_placeholder'
        calendar_data.date_span_id              = calendar_data.dom_id + '_date_view'
        calendar_data.close_calendar_event_name = "wg:calendarChanged_#{options[:grid_name]}"
        calendar_data.title                     = options[:title]
        calendar_data.fire_event                = options[:fire_event]
      end
    end
def prepare_data_for_calendar ( options ) date_format = Wice :: ConfigurationProvider . value_for ( :DATE_FORMAT ) CalendarData . new . tap do | calendar_data | calendar_data . name = options [ :name ] calendar_data . date_string = options [ :initial_date ] . nil? ? '' : options [ :initial_date ] . strftime ( date_format ) calendar_data . dom_id = options [ :name ] . gsub ( / ([ \[ \( ])|( \] \[ ) / , '_' ) . gsub ( / [ \] \) ] / , '' ) . gsub ( / \. / , '_' ) . gsub ( / _+ / , '_' ) calendar_data . datepicker_placeholder_id = calendar_data . dom_id + '_date_placeholder' calendar_data . date_span_id = calendar_data . dom_id + '_date_view' calendar_data . close_calendar_event_name = "wg:calendarChanged_#{options[:grid_name]}" calendar_data . title = options [ :title ] calendar_data . fire_event = options [ :fire_event ] end end
A struct containing all data for rendering a calendar
A struct containing all data for rendering a calendar
#:nodoc:
options