list event for today

This commit is contained in:
Peter Maquiran
2024-05-31 09:45:30 +01:00
parent 746db6f583
commit 4fad0e306f
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -228,8 +228,10 @@ export class EventsPage implements OnInit {
let date = new Date();
let month = date.getMonth() + 1;
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
if(SessionStore.user) {
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
this.showLoader = false;
@@ -40,9 +40,18 @@ export class AgendaDataService {
}
getEvents(userId: number, startDate: string, endDate: string, status: number, category: string, type: string): Observable<any> {
const params = new HttpParams()
let params = new HttpParams()
.set('UserId', userId)
.set('Status', status)
if (startDate !== null && startDate !== undefined) {
params = params.set('startDate', startDate);
}
if (endDate !== null && endDate !== undefined) {
params = params.set('endDate', endDate);
}
return this.http.get<any>(`${this.baseUrl}/Events`, { params });
}