-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dh): date range picker component
- Loading branch information
Showing
12 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...record/custom-api/custom-api.component.ts → ...rc/lib/custom-api/custom-api.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
26 changes: 26 additions & 0 deletions
26
libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div | ||
class="flex items-center justify-center w-64 h-11 rounded-lg border border-gray-300 bg-white" | ||
> | ||
<div class="w-48 flex justify-between"> | ||
<mat-date-range-input [rangePicker]="picker" class="w-full"> | ||
<input | ||
class="w-24 text-black font-basierCircle text-base font-medium text-center" | ||
matStartDate | ||
placeholder="Start date" | ||
(dateInput)="startDateSelected($event)" | ||
/> | ||
<input | ||
class="w-24 text-black font-basierCircle text-base font-medium text-center" | ||
matEndDate | ||
placeholder="End date" | ||
(dateInput)="endDateSelected($event)" | ||
/> | ||
</mat-date-range-input> | ||
</div> | ||
<mat-datepicker-toggle matSuffix [for]="picker"> | ||
<!-- <mat-icon class="text-primary material-symbols-outlined" | ||
>open_in_new</mat-icon | ||
> --> | ||
</mat-datepicker-toggle> | ||
<mat-date-range-picker #picker></mat-date-range-picker> | ||
</div> |
21 changes: 21 additions & 0 deletions
21
libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing' | ||
import { DateRangePickerComponent } from './date-range-picker.component' | ||
|
||
describe('DateRangePickerComponent', () => { | ||
let component: DateRangePickerComponent | ||
let fixture: ComponentFixture<DateRangePickerComponent> | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DateRangePickerComponent], | ||
}).compileComponents() | ||
|
||
fixture = TestBed.createComponent(DateRangePickerComponent) | ||
component = fixture.componentInstance | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy() | ||
}) | ||
}) |
20 changes: 20 additions & 0 deletions
20
libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Component } from '@angular/core' | ||
import { MatDatepickerInputEvent } from '@angular/material/datepicker' | ||
|
||
@Component({ | ||
selector: 'gn-ui-date-range-picker', | ||
templateUrl: './date-range-picker.component.html', | ||
styleUrls: ['./date-range-picker.component.css'], | ||
}) | ||
export class DateRangePickerComponent { | ||
startDate: Date | ||
endDate: Date | ||
|
||
startDateSelected(event: MatDatepickerInputEvent<Date>) { | ||
this.startDate = event.value | ||
} | ||
|
||
endDateSelected(event: MatDatepickerInputEvent<Date>) { | ||
this.endDate = event.value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters