Skip to content

Commit

Permalink
CVSL-2329 combine time and date into a single fieldset (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurps-singh authored Jan 24, 2025
1 parent b926594 commit 399c6cd
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 80 deletions.
81 changes: 37 additions & 44 deletions server/views/partials/hdc/hdcInitialMeetingTimeInputs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,43 @@
{% macro hdcInitialMeetingTimeInputs(formResponses, formDate, validationErrors) %}
{% set SPECIFIC_DATE_TIME = "SPECIFIC_DATE_TIME" %}

{% call govukFieldset({
legend: {
text: "Appointment date and time",
classes: "govuk-visually-hidden"
}
}) %}

{{ govukRadios({
id: "appointment-time-type",
name: "appointmentTimeType",
{{ govukRadios({
id: "appointment-time-type",
name: "appointmentTimeType",
value: SPECIFIC_DATE_TIME,
items: [{
value: SPECIFIC_DATE_TIME,
items: [{
value: SPECIFIC_DATE_TIME,
text: "Specific date and time"
}],
classes: "govuk-visually-hidden"
}) }}
text: "Specific date and time"
}],
classes: "govuk-visually-hidden"
}) }}

{{ hmppsDatePicker({
id: "date-calendarDate",
name: "date[calendarDate]",
label: {
text: "Date"
},
hint: {
id: "date-hint",
text: "For example, 12/11/2024"
},
errorMessage: validationErrors | findError('date'),
classes: 'hmpps-datepicker--fixed-width',
value: formResponses.date.calendarDate or formDate.date.calendarDate
}) }}

{{ hmppsDatePicker({
id: "date-calendarDate",
name: "date[calendarDate]",
label: {
text: "Date"
},
hint: {
id: "date-hint",
text: "For example, 12/11/2024"
},
errorMessage: validationErrors | findError('date'),
classes: 'hmpps-datepicker--fixed-width',
value: formResponses.date.calendarDate or formDate.date.calendarDate
}) }}
{{ timePicker({
id: "time",
label: {
text: "Time"
},
hint: {
id: "time-hint",
text: "For example, 9:30am or 2:55pm"
},
errorMessage: validationErrors | findError('time'),
formResponses: formResponses.time or formDate.time
}) }}

{{ timePicker({
id: "time",
label: {
text: "Time"
},
hint: {
id: "time-hint",
text: "For example, 9:30am or 2:55pm"
},
errorMessage: validationErrors | findError('time'),
formResponses: formResponses.time or formDate.time
}) }}
{% endcall %}
{% endmacro %}
{% endmacro %}
63 changes: 27 additions & 36 deletions server/views/partials/initialMeetingTimeInputs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,33 @@
{% set SPECIFIC_DATE_TIME = "SPECIFIC_DATE_TIME" %}

{% set dateTimeHtml %}
{% call govukFieldset({
legend: {
text: "Appointment date and time",
classes: "govuk-visually-hidden"
}
}) %}

{{ hmppsDatePicker({
id: "date-calendarDate",
name: "date[calendarDate]",
label: {
text: "Date"
},
hint: {
id: "date-hint",
text: "For example, 12/11/2024"
},
errorMessage: validationErrors | findError('date'),
classes: 'hmpps-datepicker--fixed-width',
value: formResponses.date.calendarDate or formDate.date.calendarDate
}) }}

{{ timePicker({
id: "time",
label: {
text: "Time"
},
hint: {
id: "time-hint",
text: "For example, 9:30am or 2:55pm"
},
errorMessage: validationErrors | findError('time'),
formResponses: formResponses.time or formDate.time
}) }}

{% endcall %}
{{ hmppsDatePicker({
id: "date-calendarDate",
name: "date[calendarDate]",
label: {
text: "Date"
},
hint: {
id: "date-hint",
text: "For example, 12/11/2024"
},
errorMessage: validationErrors | findError('date'),
classes: 'hmpps-datepicker--fixed-width',
value: formResponses.date.calendarDate or formDate.date.calendarDate
}) }}

{{ timePicker({
id: "time",
label: {
text: "Time"
},
hint: {
id: "time-hint",
text: "For example, 9:30am or 2:55pm"
},
errorMessage: validationErrors | findError('time'),
formResponses: formResponses.time or formDate.time
}) }}
{% endset %}

{% set appointmentTimeTypeOptions = [] %}
Expand Down

0 comments on commit 399c6cd

Please sign in to comment.