[thelist] vbscript/mssql calendar

Thomas Mayfield tgmayfield at gmail.com
Thu Oct 6 20:44:01 CDT 2005


On 10/6/05, Canfield, Joel <JCanfield at pacadvantage.org> wrote:
> I guess the real issue is getting the weekday of the first day of the
> month. I'll guess VBScript knows; it seems to be pretty smart about
> dates.
>
> joel

It's been a while, but I coded up a database-less VBscript calendar
(to use as an active desktop element) that allowed the user to change
the month, etc.  I no longer have the code for it, but it wouldn't be
hard to do up a new one (though if I had to do it again, I'd do it in
javascript), or at least point out the big logic points in rendering a
calculator.  There are very easy functions in VB for getting useful
data (such as the day of the week (and a long description for it)). 
I'll see what I can monkey together over the weekend.

If you're generating it server-side with data from SQL server, you
could just fill an array with events based on month, day, and year,
and whenever it outputs a cell/span/div for a day, it can check and
see whether anything exists in that array, and add it to the cell. 
This will slow down if the list of events get big, but allows the user
to look at multiple months/years without making successive server
calls.  You could also generate the entire calendar on the server, but
then the user has to wait for return calls for different months and
years.

--Thomas


More information about the thelist mailing list