Site hosted by Angelfire.com: Build your free website today!

CalClate 1.0

One of my favorite projects was thrown together to solve a narrow business problem: the need to work with so-called "Julian" dates or "day of the year" values.  This is the sort of thing you either use every day or else never give a thought to.

These types of "dates" are quite commonly used in business data processing and even manual paper systems.  Normally people use special desk or wall calendars to look these values up, count intervals between them, and so on.  During the recent economic downturn I encountered managers who were giving their people a hard time about ordering new "Julian" calendars as uneccessary and a waste.  Of course these same managers probably never worked with such dates on a regular basis - any many are clueless about them.

I thought this would be an easy enough thing to use their PCs for besides terminal emulation and email, and I quickly cooked up some VBScript to do the work.  I'm finally sharing the current edition with the world.  Though not finely finished, this version is pretty usable.

Form and function

This applet was written as an HTML Application (HTA).  If you haven't read my comments elsewhere regarding HTAs, I think they are one of the best ways to write Windows applications using script.

I have packaged this applet with an installer written as an HTA as well, the whole thing rolled up in an IExpress package.  This makes a tidy bundle.  I hope to write more on IExpress elsewhere.  It seems like another very neglected piece of Internet Explorer technology, much like HTAs themselves.  In the meantime you can check Microsoft's web sites (a search on MSDN may get you to the SDK documents) or try some searches on "IExpress" using your favorite search engine.  There are a few pages here and there on the Web about IExpress, and I recall a small site devoted to the topic.

CalClate?

The name CalClate is a contraction of calendar and calculator.  Not the most inventive name, but "a rose by any other name..." as they say.

The primary function of CalClate is to serve as a simple 3-month at a glance calendar that lists both the day of the year and the days left in the year for each day.  If you work with this sort of information much you'll appreciate this immediately.

As a secondary function, CalClate will help you quickly figure out dates offset (plus or minus) some number of days from a given starting date.  It will also give you the number of days between two dates.  Thus as a calculator it is limited, but useful.

Who needs it?

I hope VBScript programmers find it interesting and useful as an example of how their own HTAs can manipulate the Internet Explorer DOM (document object model) to accomplish certain styles of user interfaces in their own applications.

I believe many workers in business and government will find CalcClate another small useful tool in their daily worklife.

Limitations, work remaining

Optimization

Many operations in CalClate can be a bit slow.  Some of this is due to the large number of calculations and DOM manipluations done to create and re-create the calendar display.  I may have made some poor decisions about techniques - there is a lot of brute-force code in CalClate.  A lot of it is simply because script is slow compared to a compiled program, and CalClate does a lot of crunching for a typical script.

Windows 95, 98, Me

CalClate was developed on and for Windows 2000 Pro and Windows XP Pro machines.  Nevertheless, I have tested the installation process and most of the operation of CalClate on a Windows 95 OSR 2 machine with Internet Explorer 5.5 installed.  This is probably the "minimal" (oldest) configuration that will support CalClate.

Everything works, but some of the buttons in the "calculator" part of the window will display oddly because Unicode symbols were used.  This isn't fatal though, it just looks a little sad.

Windows 98 and later will probably fare better.  I don't anticipate problems on Windows XP Home either.

Screen resolution

I know a lot of office workers use screen resolutions as low as 640 by 480 pixels even today.  There are lots of vision impairments out there, and the workers who often most need a large sized monitor are often the last on the totem pole when it comes to getting one.

Sadly, the amount of information displayed by CalClate means it will not work at resolutions below 800 by 600 pixels.  Even worse, I haven't figured out a may to make CalClate "accessible" for workers with very severe vision limitations yet.  Mea culpa.

Downloading and installing CalClate

Downloading

You can download the CalClate installer package here.  Click on the link and when prompted select the "save to disk" or similar option offered by your browser.

Installing

Once you have downloaded the setup package to some appropriate disk location you will need to unzip it.  After unzipping you will have one file, a setup EXE.  Just double-click on the setup package to begin the installation.  In most cases the default installation location and Start Menu folder will do fine, but these can be altered during setup if you so choose.

Uninstalling

I haven't provided a nice uninstall script.  Hopefully you won't find it necessary.

If you do find it necessary to remove CalClate from your computer this is fairly easy.  Just find the Program Files folder you installed CalClate into and delete the folder and its contents.  Then delete the CalClate folder from your Start menu.

That's it.  No DLLs to unregister or files to track down in the Windows or Windows\System folders.

Using CalClate: What is CalClate? CalClate icon

CalClate is a simple calendar tool.  Its most notable features are its display of three months at a glance along with each day's day of the year ("Julian" date) and days left in the year.  CalClate offers a simplified calendar navigation mechanism and also performs a few simple kinds of date arithmetic.

As you move the calendar through various months you will notice that CalClate takes some time to adjust the display to show the new information.  This is normal, because CalClate is not a fast, compiled program.  It was created using Windows Script technology that was not designed to do large numbers of calculations or other operations very quickly.  It should meet many needs despite its lack of speed however.

Another limitation of CalClate is that it requires your screen resolution to be at least 800 by 600 pixels.  There is simply too much information to be displayed to use lower resolutions such as 640 by 480 pixels.

Using CalClate Contents

You can simply scroll through this page or click directly on individual topics below to jump directly to the places where each topic is discussed.  Clicking on different parts of the CalClate Window image will also take you to the relevant topics. This information is installed with CalClate as its "Help" Function.

Contents:

The CalClate Window

CalClate displays everything in a single window aside from this help document.  Items shown within the CalClate window are referred to in this document by names that are shown in this illustration:

Click for Calendar description Click for Calendar description Click for Current Month description Click for Month Selector description Click for Year Selector description Click for Today Panel description Click for Calculator description Click for Application Buttons description

*Contents*    *Home*

The Calendar

This is the upper part of the CalClate window, and occupies the greater part of it.  It is a three-month display of the calendar, and when CalClate opens it comes up with the present month centered.

Whenever the current date is "in view" in the Calendar area, that day is highlighted in the display using the unique "today" color, a light green.

Each day shown in the Calendar has its day of the month displayed, along with that day's day of the year ("Julian" date) and the number of days left in the year in smaller type.

You can "slide" the Calendar left or right by using the Month Selector or Year Selector buttons displayed just below the Calendar area of the window.

*Contents*    *CalClate Window*

The Current Month

Initially this center month of the Calendar area is set to the current date when CalClate is opened.  It is displayed in a different color scheme from the months preceding and following it.

This is the month (and year) currently selected via the Month Selector and Year Selector.

*Contents*    *CalClate Window*

The Month Selector

This is a strip of buttons with the Current Month in the center, the previous 10 months to the left of it, and the following 10 months to the right.

By clicking on one of these buttons you can move the Calendar area quickly to any nearby months.  The Month Selector button you click on will become the Current Month in the Calendar display area.

*Contents*    *CalClate Window*

The Year Selector

This is a strip of smaller buttons below the Month Selector.  It operates in much the same way as the Month Selector, but allows larger jumps to be made more quickly.

Most CalClate users will not need to "slide" the Calendar in larger jumps than this (10 years either side of the Current Month).

*Contents*    *CalClate Window*

The Today Panel

This area of the screen simply displays information about the current day when CalClate was opened:

CalClate window Today panel

Long Date

This is the "today" date displayed using the Windows "long date" settings of your computer.  For most of us this will include the spelled-out name of the day and month.

Short Date

This is "today" displayed using the Windows "short date" settings.  This is usually some arrangement of the day, month, and year as numbers with some separator character between them such as "-" or "/" or spaces.

Day of Year

Often called the "Julian date" (though it is not actually the Julian date at all), this is the day of the year of "today" when days are numbered consecutively from 1 starting at January 1st of the current year.

Days Left

For "today" this is the number of days remaining in the current year.  For example, December 31st will show the value 0 here.

*Contents*    *CalClate Window*

The Calculator

CalClate window calculator areaThis part of the window is used to perform a few simple date calculations.  The Calculator can be used to:

The Number Pad

This is primarily used to enter number-of-days values into the Date/days field.  You can also click on the Date or Date/days fields and type values into them directly.

The Number Buttons

Click on these to enter digits one by one.

The Left-Arrow Button

This is a simple backspace function for use when entering data via the Number Pad.

The C (Clear) Button

Click once to clear the Date/Days and Result fields.  Click a second time to clear the Date field.

*Contents*    *CalClate Window*

The Operation Buttons

These buttons perform operations on the Date, Date/days, and Result fields.

The Câ (Copy Result) Button

CalClate window calculator areaCopies the contents of the Result field (a date or a number of days) to the Windows clipboard.  Results of other operations may display here as -3 days or 45 days, but only the number (without sign) is copied.

The Pá (Paste Clipboard) Button

Pastes the contents of the Windows clipboard into the Date field if Date is empty and the clipboard contains a date.  If Date is not empty the clipboard is copied into the Date/days field.

The + (Add) Button

If Date is filled with a date and Date/days contains a number, the number of days is added to the date and the resulting date is displayed in Result.

The - (Difference) Button

If Date is filled with a date and Date/days contains a number, the number of days is subtracted from the date and the resulting date is displayed in Result.

If Date is filled with a date and Date/Days contains a number, the difference between the two dates (in days) is calculated and the result is displayed in Result.

*Contents*    *CalClate Window*

The Calendar Day Buttons

CalClate window calendar day buttonsThe body of the Calendar area is an active part of the Calculator.  Each day displayed on the Calendar is a clickable button.

If the Calculator is "clear" (click on the Clear button twice) clicking on a day copies the date of that day into the Date field.

If the Date field is already filled with a date clicking on a day copies the date of that day into the Date/days field.

To find the difference between two dates just clear the Calculator, click once on one Calendar Day, scroll the other day into view if necessary, click on the second Calendar Day, and then click on the Difference Button.

*Contents*    *CalClate Window*

The Application Buttons

CalClate window Application ButtonsThese are simple application control buttons for CalClate and appear in the lower-right corner of the window.

Home Button

The Home button "zooms" the main Calendar display to the present date (as shown in the Today Panel, i.e. to the date when CalClate was opened).

It is most useful after navigating the Calendar far into the past or future when you need to get back to dates close to today.

Print Button

This button will open a print dialog so you can print the current contents shown in the CalClate window.  For best results you may wish to set "landscape" printing in the printer settings before OKing printing.

Help Button

This button will open a web browser window and display this Help document for reference.

Close Button

The Close button simply closes CalClate when you are done with it.

You can also:

... just as with most standard Windows applications.

*Contents*    *CalClate Window*

Last words...

Please let me know about any problems you encounter, especially with the installer.  I've tested this on a number of computers, but I've run into a lot of small issues here and there that I hope are now fixed.

March 2005