From 220608708e41c86204bdf24b80374d167249b818 Mon Sep 17 00:00:00 2001 From: Prasanth-Boyina <139340256+Prasanth-Boyina@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:33:51 +0530 Subject: [PATCH] Range selection in calendar (#1034) * Enhancement(`ngx-calendar`): Supports selecting a range of dates with hours and minutes --- projects/swimlane/ngx-ui/CHANGELOG.md | 2 + .../calendar/calendar-select.enum.ts | 4 + .../calendar/calendar.component.html | 138 ++++++++++- .../calendar/calendar.component.scss | 221 +++++++++++++++++- .../components/calendar/calendar.component.ts | 155 ++++++++++++ .../components/calendar/calendar.module.ts | 5 +- .../calendar/calender.component.spec.ts | 109 +++++++++ .../calendar-page.component.html | 210 ++++++++++------- .../calendar-page/calendar-page.component.ts | 4 + 9 files changed, 754 insertions(+), 94 deletions(-) create mode 100644 projects/swimlane/ngx-ui/src/lib/components/calendar/calendar-select.enum.ts diff --git a/projects/swimlane/ngx-ui/CHANGELOG.md b/projects/swimlane/ngx-ui/CHANGELOG.md index 90d7b6af3..9e5069fe3 100644 --- a/projects/swimlane/ngx-ui/CHANGELOG.md +++ b/projects/swimlane/ngx-ui/CHANGELOG.md @@ -2,6 +2,8 @@ ## HEAD (unreleased) +- Enhancement(`ngx-calendar`): Supports selecting a range of dates with hours and minutes + ## 47.0.0 (2023-02-12) - Breaking: Angular 17 support diff --git a/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar-select.enum.ts b/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar-select.enum.ts new file mode 100644 index 000000000..576de206d --- /dev/null +++ b/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar-select.enum.ts @@ -0,0 +1,4 @@ +export enum CalendarSelect { + Single = 'single', + Range = 'range' +} diff --git a/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.html b/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.html index 96b68dd08..8afea0c14 100644 --- a/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.html +++ b/projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.html @@ -2,14 +2,28 @@
- -
@@ -17,7 +31,7 @@ {{ d }}
- +
+ + + + +
+ +
@@ -68,7 +106,7 @@ (keydown)="onMonthDown($event)" > {{ month }} - + @@ -85,7 +123,7 @@ > - +