Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
crisnicandrei committed Feb 9, 2024
1 parent 9c92e7c commit b2e940e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('FormInputComponent', () => {
},
});

const errorMessage = instance.getInputErrorFromValue('aa')
const errorMessage = instance.getInputErrorFromValue('aa');

expect(errorMessage).toBe('Must be at least 3 characters');
});
Expand Down
20 changes: 18 additions & 2 deletions src/app/views/components/timeline-view/timeline-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,14 @@ export class TimelineViewComponent implements OnInit, AfterViewInit, OnDestroy {

let firstItemBefore: DataItem;
this.timelineItems.forEach((i) => {
<<<<<<< HEAD
if (dateTypeToNumber(i.start) < midpointWithMinDiff) {
=======
if ((i.start as number) < midpointWithMinDiff) {
>>>>>>> 383faa2d (prettier)
if (!firstItemBefore) {
firstItemBefore = i;
} else if (firstItemBefore.start < i.start) {
} else if ((firstItemBefore.start as number) < (i.start as number)) {
firstItemBefore = i;
}
}
Expand All @@ -443,10 +447,14 @@ export class TimelineViewComponent implements OnInit, AfterViewInit, OnDestroy {

let firstItemAfter: DataItem;
this.timelineItems.forEach((i) => {
<<<<<<< HEAD
if (dateTypeToNumber(i.start) > midpointWithMinDiff) {
=======
if ((i.start as number) > (firstItemAfter.start as number)) {
>>>>>>> 383faa2d (prettier)
if (!firstItemAfter) {
firstItemAfter = i;
} else if (firstItemAfter.start > i.start) {
} else if ((firstItemAfter.start as number) > Number(i.start)) {
firstItemAfter = i;
}
}
Expand Down Expand Up @@ -516,12 +524,20 @@ export class TimelineViewComponent implements OnInit, AfterViewInit, OnDestroy {

findItemsInRange(start: number, end: number) {
const itemIds = [];
const startDate = new Date(start); // Convert start to a Date object
const endDate = new Date(end); // Convert end to a Date object
this.timelineItems.forEach((item) => {
const itemStart = dateTypeToNumber(item.start);
if (
<<<<<<< HEAD
itemStart >= start &&
itemStart <= end &&
(!item.end || dateTypeToNumber(item.end) <= end)
=======
item.start >= startDate &&
item.start <= endDate &&
(!item.end || item.end <= endDate)
>>>>>>> 383faa2d (prettier)
) {
itemIds.push(item.id);
}
Expand Down

0 comments on commit b2e940e

Please sign in to comment.