From 975549b7ab8386f18487fe88d720a49a3ea5bcea Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 16 Mar 2022 09:08:24 +0100 Subject: [PATCH] MOBILE-3909 calendar: Always use current time in new events --- src/addons/calendar/pages/day/day.page.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addons/calendar/pages/day/day.page.ts b/src/addons/calendar/pages/day/day.page.ts index be2c15588..5c7e7c4b9 100644 --- a/src/addons/calendar/pages/day/day.page.ts +++ b/src/addons/calendar/pages/day/day.page.ts @@ -374,7 +374,9 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { const selectedDay = this.manager?.getSelectedItem(); if (selectedDay) { - params.timestamp = selectedDay.moment.unix() * 1000; + // Use current time but in the specified day. + const now = moment(); + params.timestamp = selectedDay.moment.clone().set({ hour: now.hour(), minute: now.minute() }).unix() * 1000; } }