Module: Wice::JsCalendarHelpers

Includes:
ActionView::Helpers::AssetTagHelper, ActionView::Helpers::FormTagHelper, ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
Included in:
ViewColumnDatetime
Defined in:
lib/helpers/js_calendar_helpers.rb

Instance Method Summary collapse

Methods included from ActionView::Helpers::TagHelper

#tag_options

Instance Method Details

#date_calendar_jquery(initial_date, view, opts = {}, html_opts = {}) ⇒ Object

Jquery


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/helpers/js_calendar_helpers.rb', line 11

def date_calendar_jquery(initial_date, view, opts = {}, html_opts = {})  #:nodoc:
  date_format = Wice::ConfigurationProvider.value_for(:DATE_FORMAT)

  options, name, date_string, dom_id, datepicker_placeholder_id, date_span_id, close_calendar_event_name  =
    prepare_data_for_calendar(opts, date_format, initial_date)

  remove_date_function = %! $('##{date_span_id}').html(''); $('##{dom_id}')[0].value = ''; !

  date_picker =

    hidden_field_tag(name, date_string, :id => dom_id) + ' ' +

    link_to_function(
      (:span, date_string, :id => date_span_id),
      remove_date_function,
      :class => 'date_label',
      :title => ::Wice::WiceGridNlMessageProvider.get_message(:DATE_STRING_TOOLTIP))

  html = "<span id=\"#{datepicker_placeholder_id}\">#{date_picker}</span>"

  javascript = calendar_constructor_jquery(dom_id, view, Wice::ConfigurationProvider.value_for(:DATE_FORMAT_JQUERY),
    date_span_id, opts[:fire_event], html_opts[:title], datepicker_placeholder_id, close_calendar_event_name)

  [html, javascript]
end

#date_calendar_prototype(initial_date, view, opts = {}, html_opts = {}) ⇒ Object

Prototype


38
39
40
# File 'lib/helpers/js_calendar_helpers.rb', line 38

def date_calendar_prototype(initial_date, view, opts = {}, html_opts = {})  #:nodoc:
  select_date_datetime_common_prototype(initial_date, view, opts, html_opts, false, Wice::ConfigurationProvider.value_for(:DATE_FORMAT))
end

#datetime_calendar_prototype(initial_date, view, opts = {}, html_opts = {}) ⇒ Object

:nodoc:


42
43
44
# File 'lib/helpers/js_calendar_helpers.rb', line 42

def datetime_calendar_prototype(initial_date, view, opts = {}, html_opts = {})  #:nodoc:
  select_date_datetime_common_prototype(initial_date, view, opts, html_opts, true, Wice::ConfigurationProvider.value_for(:DATETIME_FORMAT))
end