diff --git a/app/views/examples/error-summary/index.njk b/app/views/examples/error-summary/index.njk
index d3478acc01..23aceb6c25 100644
--- a/app/views/examples/error-summary/index.njk
+++ b/app/views/examples/error-summary/index.njk
@@ -38,7 +38,7 @@
},
{
"text": "Problem with date input",
- "href": "#dateinput-day"
+ "href": "#dateinput"
},
{
"text": "Problem with date input year",
diff --git a/app/views/full-page-examples/passport-details/index.js b/app/views/full-page-examples/passport-details/index.js
index d5e80ddee1..64efc1f915 100644
--- a/app/views/full-page-examples/passport-details/index.js
+++ b/app/views/full-page-examples/passport-details/index.js
@@ -8,7 +8,7 @@ module.exports = (app) => {
body('passport-number')
.exists()
.not().isEmpty().withMessage('Enter your passport number'),
- body('expiry-day')
+ body('expiry')
.exists()
.not().isEmpty().withMessage('Enter your expiry day'),
body('expiry-month')
diff --git a/src/components/date-input/__snapshots__/template.test.js.snap b/src/components/date-input/__snapshots__/template.test.js.snap
index 7eff055d91..ae6da4a808 100644
--- a/src/components/date-input/__snapshots__/template.test.js.snap
+++ b/src/components/date-input/__snapshots__/template.test.js.snap
@@ -3,7 +3,7 @@
exports[`Date input nested dependant components passes through label params without breaking 1`] = `
diff --git a/src/components/date-input/template.njk b/src/components/date-input/template.njk
index b7d4cbacea..3cb8c936f9 100644
--- a/src/components/date-input/template.njk
+++ b/src/components/date-input/template.njk
@@ -52,16 +52,25 @@
}) | indent(2) | trim }}
{% endif %}
+ {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
{% for item in dateInputItems %}
+ {#- If the user explicitly sets an id, use this instead of the regular id parameter -#}
+ {%- if item.id -%}
+ {%- set id = item.id -%}
+ {%- else -%}
+ {%- set id = params.id -%}
+ {#- The first id should not have a prefix so it's easy to link to from the error summary component -#}
+ {%- if not loop.first -%}
+ {%- set id = id + "-" + item.name -%}
+ {%- endif -%}
+ {%- endif -%}