dcai / airnotifier

Push Notifications Server for Human Beings.
Other
593 stars 187 forks source link

... day to go Error #228

Open paymanzafar opened 3 years ago

paymanzafar commented 3 years ago

Hello everyone.

If you set the custom notifications for less than 1 day, for example for 2 hours, you will see [0.083333333 days to go] in the mobile app notification. I solved this problem (for hours) by correcting get_message_plaintext function in due_reminder.class.php file. The same function must be corrected in other files like : user_reminder.class.php, etc.

if ($this->aheaddays < 1.0 AND $this->aheaddays > 0 ) { $aheadhours = $this->aheaddays*24; $this->get_message_title().' ['.$this->pluralize($aheadhours, ' hour').' to go]'."\n"; } else { $this->get_message_title().' ['.$this->pluralize($this->aheaddays, ' day').' to go]'."\n"; }

The same applies for custom notifications in minutes, or seconds.