From 1eb2842f5ac4960d23ce475fe230a66d80b7a4fc Mon Sep 17 00:00:00 2001
From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Tue, 4 Mar 2025 19:45:26 -0800
Subject: [PATCH] Revert "Just save this"
This reverts commit 1ecfd44ee166ed6e63f2cb8488f1309370785481.
---
.../dates-dropdown.component.html | 70 +++++++-----
.../dates-dropdown.component.scss | 7 +-
.../dates-dropdown.component.ts | 100 +-----------------
3 files changed, 44 insertions(+), 133 deletions(-)
diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html
index e80bedc1d..c3ff61ba8 100644
--- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html
+++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.html
@@ -40,8 +40,17 @@
@@ -57,16 +66,20 @@
-
-
-
-
-
@@ -121,29 +143,21 @@
-
-
-
-
-
-
-
- {{ date.day }}
-
-
diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss
index ba4180ba2..ebd34b29a 100644
--- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss
+++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.scss
@@ -2,7 +2,7 @@
white-space: nowrap;
@media(min-width: 768px) {
- --bs-dropdown-min-width: 38rem;
+ --bs-dropdown-min-width: 40rem;
}
@media screen and (max-width: 767px) {
@@ -47,8 +47,3 @@
border-radius: 0.15rem;
}
}
-
-::ng-deep .ngb-dp-day, .day {
- height: 2.3rem !important;
- width: 2.3rem !important;
-}
diff --git a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
index 25fbeee83..e7d506d18 100644
--- a/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
+++ b/src-ui/src/app/components/common/dates-dropdown/dates-dropdown.component.ts
@@ -9,7 +9,6 @@ import {
} from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import {
- NgbDate,
NgbDateAdapter,
NgbDatepickerModule,
NgbDropdownModule,
@@ -58,10 +57,7 @@ export enum RelativeDate {
export class DatesDropdownComponent implements OnInit, OnDestroy {
public popperOptions = popperOptionsReenablePreventOverflow
- constructor(
- settings: SettingsService,
- private isoDateAdapter: NgbDateAdapter
- ) {
+ constructor(settings: SettingsService) {
this.datePlaceHolder = settings.getLocalizedDateInputFormat()
}
@@ -100,10 +96,6 @@ export class DatesDropdownComponent implements OnInit, OnDestroy {
@Input()
createdDateFrom: string
- createdDate: string
- addedDate: string
- hoveredDate: NgbDate
-
@Output()
createdDateFromChange = new EventEmitter()
@@ -194,52 +186,6 @@ export class DatesDropdownComponent implements OnInit, OnDestroy {
this.onChange()
}
- isHovered(date: NgbDate) {
- const createdDateFromNgbDate = this.createdDateFrom
- ? NgbDate.from({
- year: new Date(this.createdDateFrom).getFullYear(),
- month: new Date(this.createdDateFrom).getMonth() + 1,
- day: new Date(this.createdDateFrom).getDate(),
- })
- : null
- return (
- this.createdDateFrom &&
- !this.createdDateTo &&
- this.hoveredDate &&
- date.after(createdDateFromNgbDate) &&
- date.before(this.hoveredDate)
- )
- }
-
- isInside(date: NgbDate) {
- const createdDateFromNgbDate = this.createdDateFrom
- ? NgbDate.from(this.isoDateAdapter.fromModel(this.createdDateFrom))
- : null
- const createdDateToNgbDate = this.createdDateTo
- ? NgbDate.from(this.isoDateAdapter.fromModel(this.createdDateTo))
- : null
- return (
- this.createdDateTo &&
- date.after(createdDateFromNgbDate) &&
- date.before(createdDateToNgbDate)
- )
- }
-
- isRange(date: NgbDate) {
- const createdDateFromNgbDate = this.createdDateFrom
- ? NgbDate.from(this.isoDateAdapter.fromModel(this.createdDateFrom))
- : null
- const createdDateToNgbDate = this.createdDateTo
- ? NgbDate.from(this.isoDateAdapter.fromModel(this.createdDateTo))
- : null
- return (
- date.equals(createdDateFromNgbDate) ||
- (this.createdDateTo && date.equals(createdDateToNgbDate)) ||
- this.isInside(date) ||
- this.isHovered(date)
- )
- }
-
onChange() {
this.createdDateToChange.emit(this.createdDateTo)
this.createdDateFromChange.emit(this.createdDateFrom)
@@ -257,50 +203,6 @@ export class DatesDropdownComponent implements OnInit, OnDestroy {
})
}
- onCreatedChange() {
- const createdNgbDate = NgbDate.from(
- this.isoDateAdapter.fromModel(this.createdDate)
- )
-
- if (!this.createdDateFrom && !this.createdDateTo) {
- this.createdDateFrom = this.isoDateAdapter.toModel(createdNgbDate)
- } else if (
- this.createdDateFrom &&
- !this.createdDateTo &&
- createdNgbDate.after(
- NgbDate.from(this.isoDateAdapter.fromModel(this.createdDateFrom))
- )
- ) {
- this.createdDateTo = this.isoDateAdapter.toModel(createdNgbDate)
- } else {
- this.createdDateTo = null
- this.createdDateFrom = this.isoDateAdapter.toModel(createdNgbDate)
- }
- this.onChangeDebounce()
- }
-
- onAddedChange() {
- const addedNgbDate = NgbDate.from(
- this.isoDateAdapter.fromModel(this.createdDate)
- )
-
- if (!this.addedDateFrom && !this.addedDateTo) {
- this.addedDateFrom = this.isoDateAdapter.toModel(addedNgbDate)
- } else if (
- this.addedDateFrom &&
- !this.addedDateTo &&
- addedNgbDate.after(
- NgbDate.from(this.isoDateAdapter.fromModel(this.addedDateFrom))
- )
- ) {
- this.addedDateTo = this.isoDateAdapter.toModel(addedNgbDate)
- } else {
- this.addedDateTo = null
- this.addedDateFrom = this.isoDateAdapter.toModel(addedNgbDate)
- }
- this.onChangeDebounce()
- }
-
onChangeDebounce() {
this.createdRelativeDate = null
this.addedRelativeDate = null