RSS Feed

a playground of art, photos, videos, writing, music, life

 


You are here







Random Quote

The deepest quality of a work of art will always be the quality of the mind of the producer ...No good novel will ever proceed from a superficial mind.
-- Henry James


 

Blog - Blog Archive by Month - Blog Archive by Tag - Search Blog and Comments

<-- Go to Previous Page

Recurrence

 

Tonight, I'm working on the recurrence engine that will be sewn into 247Toolset's event calendar function, which is based on my development from over five years ago, the EverywhereCalendar.

I currently have two bugs left that I know of:

  1. For some reason, if I select that the event will occur every other weekend, the dates list out Saturday one week, Sunday the next, and so on. Grrr...
  2. If I choose the second and fourth Thursday of every month, it shows up instead as weekly. It's not doing the second and fourth week only.
I'll likely have both bugs worked out before I go to bed (famous last words), but it's the testing that makes this interesting. I had to build a little test page for my local server, and all night, I'm running through various options, and tweaking and fixing as I go.

One of the things that I'm putting into mine is the ability to say that the events should only occur on business days. It automatically excludes weekends and holidays if you choose that option. Therefore, if I say that my event occurs on the 1st and 15th of every month starting from today (2/22/2011), I get this back:

Tuesday 3/1/2011
Tuesday 3/15/2011
Friday 4/1/2011
Friday 4/15/2011
Monday 5/2/2011
Monday 5/16/2011
Wednesday 6/1/2011
Wednesday 6/15/2011
Friday 7/1/2011
Friday 7/15/2011

Notice how it bumped May 1st and May 15th one day forward.

That seems like a nice feature.

Nicer yet would be that each client can create their own list of holidays. American Thanksgiving is not Canadian Thanksgiving. July 4th means nothing to Mexicans.

Also - depending on the organization, maybe Saturday is considered a business day. My favorite bakery in town always takes Monday off.

And look at the ways in which recurrence can take place:

Weekly? Or monthly?

If it's weekly, is it every week? Every other week? Every fourth week? Which days of the week?

If it's monthly, is it by weekday - such as the third Tuesday of every month? Or it is by date - the 10th and 25th, for example? Or maybe the first Monday of every third month? Or what about the last day of every other month?

Lots and lots of variations...

And then the interface. How do I present all of these options to everyone so that it's clear and obvious?

Rather than look at how others have done it, I usually like to take a pass at it myself first. It's more work, but I find that I sometimes make considerations that didn't occur to someone else.

Take a look at Google's interface:

I can't toggle more than one date or more than one weekday during the month for an event. And no allowance for business days.

Is mine better? I don't know about that... but it is different, and in some ways more thorough.

Here's Microsoft's within Outlook 2010:

Pretty much the same as Google. Neither interface will allow me to say that my team meets the first and third Friday of of every month. I can only set it up for the first Friday of the month. Sure, I could set up a second meeting with recurrence for the third Friday of every month - but isn't the object of having a recurrence engine to avoid duplicate entry?

Considerations... that's all this is. What I do know is that mine will be different for having walked it through myself. My market will tell me whether I need to change it and add more to it.

So, back to testing and fixing before I get to bed tonight :)

ETC: Didn't solve either problem before I went to bed. It turns out that the reason for the odd spacing between every other weekend is due to the way the week is set up. My programming was doing exactly what I told it to do.

If I ask you to tell me the days of a week, you might respond with Sunday through Saturday. If you look on a calendar, that's certainly how it's represented.

And I then tell you that every other week, we'll select Sunday and Saturday, you might see how the computer would pick:

Sunday, the following Saturday, then the Sunday eight days later, then the next Saturday, and so on.

But we humans actually group Sunday and Saturday together. We call it a weekend, and we never refer to it as Sunday and Saturday, but rather as Saturday and Sunday - even though each weekend spans two separate weeks. You see? Sunday is well known to be the first day of a new week. My programming saw each day as a separate week, and therefore never grouped the two weekdays together.

So I have to pick a start for a new week other than Sunday if it's likely that people will intuitively group the weekend days together for activities on a calendar, which they will. It's far less frequent that someone will choose to bundle an activity on Sunday and Monday every other week, so Monday has to be the start of a new week in my recurrence engine.

Which meant a rewrite, which meant sleep first.

 


by Brett Rogers, 2/22/2011 11:59:55 PM
Permalink


Comments

Add Your Comment:
Name (required):
Web Site:
Remember Me:   
Content: (4000 chars remaining)
To prevent spammers from commenting, please give a one-word answer to the following trivia question:

What color is the house of the president of the United States?