diff --git a/app/helpers/legislation_helper.rb b/app/helpers/legislation_helper.rb index 59a13f9a8..1692cf326 100644 --- a/app/helpers/legislation_helper.rb +++ b/app/helpers/legislation_helper.rb @@ -3,6 +3,10 @@ module LegislationHelper l(date, format: "%d %b %Y") if date end + def format_date_for_calendar_form(date) + l(date, format: "%d/%m/%Y") if date + end + def legislation_question_path(question) legislation_process_question_path(question.process, question) end diff --git a/app/views/admin/legislation/processes/_form.html.erb b/app/views/admin/legislation/processes/_form.html.erb index d1643747c..06bcfd43c 100644 --- a/app/views/admin/legislation/processes/_form.html.erb +++ b/app/views/admin/legislation/processes/_form.html.erb @@ -25,6 +25,7 @@
<%= f.text_field :start_date, label: false, + value: format_date_for_calendar_form(@process.start_date), class: "js-calendar-full", id: "start_date" %>
@@ -34,6 +35,7 @@
<%= f.text_field :end_date, label: false, + value: format_date_for_calendar_form(@process.end_date), class: "js-calendar-full", id: "end_date" %>
@@ -47,6 +49,7 @@
<%= f.text_field :debate_start_date, label: false, + value: format_date_for_calendar_form(@process.debate_start_date), class: "js-calendar-full", id: "debate_start_date" %>
@@ -56,6 +59,7 @@
<%= f.text_field :debate_end_date, label: false, + value: format_date_for_calendar_form(@process.debate_end_date), class: "js-calendar-full", id: "debate_end_date" %>
@@ -69,6 +73,7 @@
<%= f.text_field :allegations_start_date, label: false, + value: format_date_for_calendar_form(@process.allegations_start_date), class: "js-calendar-full", id: "allegations_start_date" %>
@@ -78,6 +83,7 @@
<%= f.text_field :allegations_end_date, label: false, + value: format_date_for_calendar_form(@process.allegations_end_date), class: "js-calendar-full", id: "allegations_end_date" %>
@@ -88,6 +94,7 @@
<%= f.text_field :draft_publication_date, label: false, + value: format_date_for_calendar_form(@process.draft_publication_date), class: "js-calendar-full", id: "draft_publication_date" %>
@@ -100,6 +107,7 @@
<%= f.text_field :final_publication_date, label: false, + value: format_date_for_calendar_form(@process.final_publication_date), class: "js-calendar-full", id: "final_publication_date" %>