Telerik-Verified-Plugins / LocalNotification

Apache License 2.0
21 stars 27 forks source link

"at" problem #15

Closed nayhibsonga closed 8 years ago

nayhibsonga commented 8 years ago

hello, I have a problem when inserting the date, i do new date () but the event begins immediately. this is my code:

  var horanotificacion = new Date();
  horanotificacion.setHours(hours);
  horanotificacion.setMinutes(minutes);
  var options = {
  id:1 
  at: new Date(horanotificacion),
  text:"Hello World",
  title:"Hello World",
  every:'day',
  icon:"res://drawable-land-hdpi/icon.png",
  sound:sonido,  
  autoClear:true, 
  ongoing:false,
  };
  cordova.plugins.notification.local.schedule(options);
EddyVerbruggen commented 8 years ago

I'm not sure what the value of your hours and minutes params are, but if you do it like this it should schedule a notification for 1 minute from now:

var d = new Date();
d.setMinutes(d.getMinutes() + 1);