You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use this plugin to set up daily reminders for the user. The user can choose the time of the reminder then the app schedules the notification with 'day' interval. I was trying to create the date object like this:
constdate=newDate();date.setHours(15,0);// actually it's a variable with the value the user set
The problem is that when I console.log the date, it shows the right hour/minute but in the wrong timezone (UTC), when the device (in this case an Android Emulator) is actually running with GMT -3 timezone (America/Sao_Paulo).
In any case, I tried to set up the notification to see what happens, but the notification won't show. I tried in a lot of different ways, using Unix time, using moment, moment-timezone, but each time I tried it would not give the right result.
The question I would ask here is: how to handle timezones when scheduling the notification?
But, I tried using the demo this repository provides, where it schedules the notification to 5 seconds from now using this:
newDate(newDate().getTime()+(5*1000));
And guess what? It doesn't show after 5 seconds, but after like 2 minutes. I also tried using different values (like 3-5 minutes), but they also show at the wrong time. This made me think that maybe whatever causing this is also related to the timezone problem I'm having.
In any case, any help on this would be very appreciated.
PS: Tested only on Android
The text was updated successfully, but these errors were encountered:
I'm trying to use this plugin to set up daily reminders for the user. The user can choose the time of the reminder then the app schedules the notification with 'day' interval. I was trying to create the date object like this:
The problem is that when I
console.log
the date, it shows the right hour/minute but in the wrong timezone (UTC), when the device (in this case an Android Emulator) is actually running with GMT -3 timezone (America/Sao_Paulo).In any case, I tried to set up the notification to see what happens, but the notification won't show. I tried in a lot of different ways, using Unix time, using
moment
,moment-timezone
, but each time I tried it would not give the right result.The question I would ask here is: how to handle timezones when scheduling the notification?
But, I tried using the demo this repository provides, where it schedules the notification to 5 seconds from now using this:
And guess what? It doesn't show after 5 seconds, but after like 2 minutes. I also tried using different values (like 3-5 minutes), but they also show at the wrong time. This made me think that maybe whatever causing this is also related to the timezone problem I'm having.
In any case, any help on this would be very appreciated.
PS: Tested only on Android
The text was updated successfully, but these errors were encountered: