Skip to content

Commit

Permalink
feat(cb2-8712): added validation to time
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Searle committed Jul 18, 2023
1 parent 80efb29 commit 84e44e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/forms/components/date/date.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<legend class="govuk-fieldset__legend govuk-fieldset__legend--m">{{ label }}</legend>
<div *ngIf="hint" id="{{ name }}-hint" class="govuk-hint">{{ hint }}</div>
<app-field-error-message
*ngIf="dayEl.dirty && monthEl.dirty && yearEl.dirty && (yearEl.value ?? '').length > 3"
*ngIf="(dayEl.dirty && monthEl.dirty && yearEl.dirty && (yearEl.value ?? '').length > 3) || displayTime"
[error]="error"
[name]="name"
></app-field-error-message>
Expand Down Expand Up @@ -86,6 +86,11 @@
</div>

<ng-container *ngIf="displayTime">
<app-field-error-message
*ngIf="(dayEl.dirty && monthEl.dirty && yearEl.dirty && (yearEl.value ?? '').length > 3) || (displayTime && hourEl.dirty)"
[error]="error"
[name]="name"
></app-field-error-message>
<div class="govuk-date-input__item">
<div class="govuk-form-group">
<label class="govuk-label govuk-date-input__label" for="{{ name }}-hour"> Hour </label>
Expand Down

0 comments on commit 84e44e0

Please sign in to comment.