Skip to content

Commit

Permalink
Merge pull request #5400 from romanblanco/bz1686077
Browse files Browse the repository at this point in the history
Showing default value for date/time picker in service dialog preview

(cherry picked from commit bf21a6e)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1712462
  • Loading branch information
h-kataria authored and simaishi committed May 21, 2019
1 parent f3a5226 commit 2d87743
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/miq_ae_customization/_dialog_sample.html.haml
Expand Up @@ -33,14 +33,14 @@
- when "DialogFieldCheckBox"
= check_box_tag(field_id, "1", field.default_value == 't', :disabled => true)
- when "DialogFieldDateControl", "DialogFieldDateTimeControl"
- time = field.default_value.present? ? Time.zone.parse(field.default_value) : Time.zone.now
- if field.show_past_dates
:javascript
ManageIQ.calendar.calDateFrom = undefined;
- else
:javascript
ManageIQ.calendar.calDateFrom = new Date("#{Time.zone.now.strftime("%Y, %m, %d")}");
- t = Time.zone.now + 1.day
- date_val = field.value ? field.value.split(" ") : ["#{t.month}/#{t.day}/#{t.year}"]
- date_val = ["#{time.month}/#{time.day}/#{time.year}"]
= datepicker_input_tag("miq_date_1", h(date_val[0]),
:class => "css1",
:readonly => "true",
Expand All @@ -49,9 +49,9 @@
 
= _('at')
 
= select_tag("start_hour", options_for_select(Array.new(24) { |i| i }, 0))
= select_tag("start_hour", options_for_select(Array.new(24) { |i| i }, time.hour))
\:
= select_tag("start_min", options_for_select(Array.new(12) { |i| i * 5 }, 0))
= select_tag("start_min", options_for_select(Array.new(12) { |i| i * 5 }, time.min))

- when "DialogFieldTextAreaBox"
= text_area_tag(field.id, field.sample_text, :size => "50x6", :disabled => true)
Expand Down

0 comments on commit 2d87743

Please sign in to comment.