Revisiting the JavaScript Calendar Control – Part 2

Show your scripts who’s the boss! Check out The Little Book of JavaScript!

Following last week’s implementation of the basic shape of the calendar, this week we will add behaviours so that we can pick a date on it.

This post is part of a series of three posts:

Revisiting the JavaScript Calendar Control – Part 1

Tame the scripting beast. Check out The Little Book of JavaScript!

A few years ago, I wrote a calendar control for a Code Project article. Although I’ve used it myself several times, and despite the fact that people still appear to be using it, I can’t help but cringe every time I look at it again. Every time, the thought that comes to mind is “It could have been so much cleaner in jQuery…”.

Well, the time has come to bite the bullet and see how it can be pulled off again. Rather than going over the whole thing in one go though, we’re going to take it in steps over a number of posts to implement a feature or a group of features, so we can look each in slightly more detail. This is as much for my benefit as everyone else’s. If anyone spots anything weird, inefficient, or badong in these posts, please let me know. I like to think of this as public code review, so, you know. Bring it on.

We can rebuild him – we have the technology

The posts will be divided as follows:

  • In part 1 (this post), we will deal with the display of a simple static calendar.
  • In part 2, we will add the facility to pick a date, and to switch the month on display.
  • In part 3, we will add some sanity checks, and the ability to display events on given days.

And with that, on to the post itself. Continue reading “Revisiting the JavaScript Calendar Control – Part 1”

New theme for The Simple Part

Despite my best attempts at procrastination, it had to happen sooner or later. Stephen Reinhardt’s Light theme, the free version of which has served this blog well and faithfully for the last year and something, has finally been decommissioned. Replacing it is a new theme I clobbered together over the last week.

One of the reasons I moved this blog off the old wordpress.com subdomain – the only reason in fact – was to allow me to mess around with it as much as possible. Writing the theme is one such messing, though a number of things got in the way and meant that it took a while longer to get started than originally intended.

This theme will be considered a permanent work in progress. I’d be interested in any comments, complaints or suggestions concerning its usability (or lack thereof), appearance (or hideousness thereof), or anything else which may be handy or simply cool.

With thanks to Emilyn and SZC, whose advice prevented a number of crimes against aesthetics and partly offset my inability to work with colour schemes more complex than black and white.