lavigor / notifications

Web Push Notifications come to phpBB boards!
GNU General Public License v2.0
7 stars 6 forks source link

Android Chrome - wrong date of notification #11

Open obagley opened 6 years ago

obagley commented 6 years ago

Noticed a problem with notification date on Android Chrome. It pops up with 18-01-1970 date, instead of the time of the day as for other Android notifications. 18 clearly comes from the 2018 year.

For now the workaround I found is to replace this line

https://github.com/lavigor/notifications/blob/feee2f30772ba7317c6424855c9c4fee9b92a5b0/styles/all/template/js/sw.js#L59

with timestamp: Date.now(),

This gave the correct behaviour with the time of the day in the Android Chrome notifications.

lavigor commented 6 years ago

Thank you for reporting the issue, I'll look into it when I have time.

Toutenkit commented 3 years ago

Work with timestamp: data.time * 1000,

Android Chrome 91.0.4472.88 and all media