katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.56k stars 1.75k forks source link

Problem to define time of message #1004

Closed euthanato closed 7 years ago

euthanato commented 8 years ago

I have trouble setting the time, it does not run when I ask and I have no idea how to do it, please can you help me?

Here the code:

var time = new Date(); var year = time.getUTCFullYear(); var month = time.getUTCMonth() + 1; var day = time.getUTCDate(); var hour = '08'; var min = '00'; var reserv = new Date(year,month,day,hour,min); cordova.plugins.notification.local.schedule({ id: 1, title: "BeShanti", text: "Detox", every: "day", // "minute", "hour", "week", "month", "year" firstAt: reserv, //at: alarma, icon: "img://logo.jpg" });

leifwells commented 8 years ago

My IDE gives me an error when I try to use the strings for hour and min to create a Date. Date is expecting numbers.

When I change these lines I get a notification created one month from today at 8AM.

var hour = 8; var min = 0;

rwillett commented 7 years ago

Is this still an issue? Its not been updated in six months?

rwillett commented 7 years ago

No update from original poster so closing.