An Accessible Input with Description and Error Message

How to flag to the input that those spans are errors and descriptions linked to itself using `aria-labelledby` and `aria-describedby`

<div>
<label id="email-label" for={name}>
Insert a date
</label>

<input
id="date"
name="date"
aria-labelledby="date-label date-hint"
aria-describedby="data-error"
>


<span id="date-hint">
MM/YY
</span>

<span id="date-error">
Must be future date!
</span>
</div>

Reference: