Device in 12h time format, notification scheduled time shows as invalid date
I pass timestamp to schedule local notification and repeat type is daily. This works when device is in 24 time format but when its in 12h time format notification object look like this
{
soundName: null,
id: '165723694',
date: Invalid Date,
number: 1,
message: "Some message",
title: "Some title"
}
It fires today but for next day does not trigger notification.
Hi @branislavantic87
If you provide an Invalid Date, it's not a valid date, so how do you expect it to work ?
Provide a full reproducible exemple if I do not understand but a valid date is required...
Regards
Hello @Dallas62 As I said I pass unix timestamp which is valid when phone is in 24 time format, and somehow not valid when device is in 12h time format. Date is valid I assure you, it would work when device is in 24 time format.
The library expects a JS Date Object, not a timestamp
Ok will try that
@Dallas62
I've done some research and I need to update you.
Method getScheduledLocalNotifications() takes notif.date property, line 541 date: (notif.date ? new Date(notif.date) : null). So when phone is in 12h time format which is returned from push-notification-ios formatted like this
'2021-05-21T1:55:00.000+02:00', Invalid Date is returned from parsing to js date object.
Do you have any idea how could this be bypassed/solved?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.