Results 1 to 3 of 3

Thread: pop up alert based on appointment time

  1. #1
    Join Date
    Feb 2013

    Lightbulb pop up alert based on appointment time

    I have developed scheduler in which admin can make appointments of a patient on paticular date & time,and i want alert pop up before 10min of appointment..i tried but wnt get...How to get pop up alert by using javascript..do we have to use thread programming???

  2. #2
    Join Date
    Feb 2013
    Probably not optimal, but you can have a function that checks the time and sees if there are any appointments within 10 minutes. Popup a reminder if there is. Then you set this function to run periodically.

  3. #3
    Join Date
    Feb 2013
    You don't need thread programming to do that in javascript. You nead timing events:

    and to use objects of type date:

    you can implement something similar to this code that I've written:

    <script type="text/javascript">
    var mins_alert=10;
    function alert_func(){
    	alert("in "+mins_alert+" minutes you will have an appointment!");
    function caller(){
    	//get the current date
    	var now = new Date();
    	//get the next event (these values should come from a database or somewhere, and be update each time that the caller function is run...)
    	var month_str="february";
    	var day=28;
    	var year=2013;
    	var hours=22;
    	var mins=57;
    	var secs=0;
    	var next_event = new Date(month_str+day+", "+year+" "+hours+":"+mins+":"+secs);
    //	alert("now:\n"+now);
    //	alert("next_event:\n"+next_event);
    	var delta_millisecs = next_event.getTime()-now.getTime();	//difference, in milliseconds, between these the current date and the date of the next appointment
    	var delta_t = delta_millisecs-mins_alert*60*1000;		//number of milliseconds between now to the alert event
    	if (delta_t>0){
    		setTimeout("alert_func()", delta_t);
    Hope that helps!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center