Calendar or Date controls, also called date drop downs may seem very simple and would not warrant a page, however as there are hidden elements to using these I thought it worthwhile placing all the information in the one place.
Here is an example of two calendar/date controls on a form. When you click on the drop down portion of the control (the arrow thingy on the right hand side) a calendar of the month is displayed.
You can now see the complete month and at the start and end of the month are greyed out days from the previous and next months. Even though they are greyed they still work. If you click on them the date will be inserted in the display portion – the bit you normally see that is not part of the drop-down area.
You can move around the calendar area using the up and down, left and right arrows. You should be aware that if you use say the up arrow then, when it gets to the top of the screen it will jump back into the previous month. Likewise left and right arrows do the same, except that they snake down through the current month and do not change months until the highlighted cell reaches the greyed dates.
Clicking on the arrows either side of the month at the top of the drop-down area takes you to the previous or next month.
The red square and day will set the calendar to today’s date if you click on that line. If you click on a day to goes to the day and closes the drop down.
When the month drop-down is open there is also a method of changing the year. You do NOT have to scroll back though many months to get to the year you want.
On the example shown click on the year 2011 and you will now see this:
Unfortunately you cannot simply type a year into the box. You can only use the arrows to change the year.
Clicking a date or pressing Enter (Return) will store the selected year and display the calendar drop down for the current month selected.
There are more hidden gems in the calendar box.
Click in the month name at the top and you get a drop down list of the months.
Simply click on the month you want to go to.
And there is more.
In the display area, in other words NOT in the drop down, you can click the day, month or year portion and it will be highlighted.
You can now use the up and down arrows to go up and down the values range. These roll round for months and days.
Using the left and right arrow keys you can change the selected area.
Such a versatile little control. Worth a page on it’s own I feel!