Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
#270 Voir tout l'historique sur Mon Rucher
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvJalb committed Apr 20, 2022
1 parent 4f39ee2 commit 14286bd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/dashboard/service/api/inspection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ export class InspectionService {
}

getInspectionCurrentApiary(apiaryId: string): Inspection[]{
let start = new Date();
start.setDate(start.getDate() - 180);
return this.inspectionsApiary.filter(_insp => (_insp.apiaryId === apiaryId && new Date(_insp.opsDate) > start)).sort((inspA, inspB) => {
// let start = new Date();
// start.setDate(start.getDate() - 180);
return this.inspectionsApiary.filter(_insp => (_insp.apiaryId === apiaryId /*&& new Date(_insp.opsDate) > start*/)).sort((inspA, inspB) => {
return -(moment(inspA.opsDate).unix() - moment(inspB.opsDate).unix());
});
}

getInspectionCurrentHive(hiveId: string): Inspection[]{
let start = new Date();
start.setDate(start.getDate() - 180);
return this.inspectionsHive.filter(_insp => (_insp.hiveId === hiveId && new Date(_insp.opsDate) > start )).sort((inspA, inspB) => {
// let start = new Date();
// start.setDate(start.getDate() - 180);
return this.inspectionsHive.filter(_insp => (_insp.hiveId === hiveId /*&& new Date(_insp.opsDate) > start*/ )).sort((inspA, inspB) => {
return -(moment(inspA.opsDate).unix() - moment(inspB.opsDate).unix());
});
}
Expand Down

0 comments on commit 14286bd

Please sign in to comment.