Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(viewer): improve style of date input (DSP-1724) #301

Merged
merged 3 commits into from Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -11,12 +11,14 @@
<mat-label>Year</mat-label>
<input class="year" matInput placeholder="Year" type="number" [formControlName]="'year'" min="1"
(input)="_handleInput()">
<mat-error *ngIf="yearControl.hasError('required')">
<span class="custom-error-message">A year is <strong>required</strong>.</span>
</mat-error>
<mat-error *ngIf="yearControl.hasError('min')">
<span class="custom-error-message">A valid year is greater than 0.</span>
</mat-error>
<div class="date-form-error">
<mat-error *ngIf="yearControl.hasError('required')">
<span class="custom-error-message">A year is <strong>required</strong>.</span>
</mat-error>
<mat-error *ngIf="yearControl.hasError('min')">
<span class="custom-error-message">A valid year is greater than 0.</span>
</mat-error>
</div>
</mat-form-field>
<mat-form-field>
<mat-label>Month</mat-label>
Expand Down
Expand Up @@ -3,3 +3,7 @@
.era-radio {
margin-bottom: 15px;
}

.date-form-error {
margin-top: -16px;
}
Expand Up @@ -21,20 +21,20 @@
<div class="date-form-grid">
<div class="date-form-field">
<mat-form-field>
<mat-label *ngIf="isPeriodControl.value">Start</mat-label>
<dsp-date-edit class="start-date" [formControlName]="'startDate'" [calendar]="calendarControl.value" [valueRequiredValidator]="valueRequiredValidator"></dsp-date-edit>
</mat-form-field>
</div>
</div>

<span *ngIf="isPeriodControl.value">
<div class="date-form-grid">
<span *ngIf="isPeriodControl.value">
<div class="date-form-field">
<mat-form-field>
<mat-label>End</mat-label>
<dsp-date-edit class="end-date" [formControlName]="'endDate'" [calendar]="calendarControl.value" [valueRequiredValidator]="valueRequiredValidator"></dsp-date-edit>
</mat-form-field>
</div>
</div>
</span>
</span>
</div>

<div class="date-form-error">
<mat-error *ngIf="startDate.hasError('required')">
Expand Down
Expand Up @@ -7,7 +7,7 @@

.date-form-grid {
display: grid;
grid-template-columns: 49% 49%;
grid-template-columns: 30% 30%;
grid-template-rows: auto;
column-gap: 12px;
}
Expand Down