My daily planner application was delayed a couple weeks by a number of unexpected interruptions, but I'm getting close to wrapping it up now:
http://www.radile.com/rdweb/temp/cal100.html
On the 2nd screen-shot you might notice a number of input elements for defining Alerts. Alerts are just standard window.alert() popups before scheduled events occur. Another tab (not shown) may be used to define automated telephone, phone text message, and email reminders that may occur from a batch process. But Alerts are just for the person using the calendar.
I was pleased to discover window.setInterval() in the DOM tutorial at w3schools to fire an event to determine whether an Alert was due, and if so, show the popup.
At first, I considered querying the database at intervals of perhaps 30 seconds to see whether an Alert was due. Then I hesitated about adding that kind of workload to the server. What if 1000 users had the calendar open all day long? If I understand the math, that would result in 2,880,000 requests per day, for a few silly Alerts.
Then I considered downloading a person's scheduled events to the browser, using an array for storage, and just scanning the array at regular intervals. But this is a team application, where any member may schedule events for any other team member. So the browser's data store could get out of sync with the server's data store.
Maybe there should be some sort of compromise. Hmmm...
Well, this is still one of my favorite applications, and incorporates quite a few interesting elements. I need to figure out do do this ...
After all, Google did it, I think.
My wife asked for an alert the day before an event, in addition to the day of the event.
Hmmm... Add a field to the event to indicate the next scheduled alert?
Aren't Web apps fun?
As an Amazon Associate we earn from qualifying purchases.