Skip to content

Commit

Permalink
sonar house keeping
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaed Parkar committed Sep 11, 2023
1 parent 63daa1d commit adde385
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ export class BookingsListService {
private insertDateGroup(element: BookingsListModel, bookings: Array<BookingsListModel>) {
bookings.push(element);
bookings.sort((a, b) => {
if (new Date(a.BookingsDate) < new Date(b.BookingsDate)) {
const dateA = moment(a.BookingsDate);
const dateB = moment(b.BookingsDate);
if (dateA.isBefore(dateB)) {
return -1;
}
if (new Date(a.BookingsDate) > new Date(b.BookingsDate)) {
if (dateA.isAfter(dateB)) {
return 1;
}
if (new Date(a.BookingsDate) === new Date(b.BookingsDate)) {
if (dateA.isSame(dateB)) {
return 0;
}
});
Expand Down

0 comments on commit adde385

Please sign in to comment.