Home page  
Help >
DDL Command CALENDAR
Version 7.11
CALENDAR

The CALENDAR command provides a pop-up calendar that is used to prompt the user for a date, a date range, or a sequence of dates. The CALENDAR command can be abbreviated CAL.

Form1:
CALENDAR/options %v [date [template]] [TITLE "literal"] [x,y]
[DELIMITER IS "character"]
Form2:
CALENDAR/options %v %v2 [date [template]] [TITLE "literal"] [x,y]

Notation standards Options Answers

Options:
K -Used in Form1 to request multiple date selections
X -Suppress the command response
Y -Do not alter the command answer cells

Answers:
Form1 when no K option is used:
Ctl.Ans1 =The day of the month associated with %v
Ctl.Ans2 =Zero
Ctl.Ans3 =Zero

Form1 when K option is used:
Ctl.Ans1 =The julian date of the last date selected
Ctl.Ans2 =The julian date of the last date selected
Ctl.Ans3 =The number of individual dates selected

Form2:
Ctl.Ans1 =The day of the month assocated with %v
Ctl.Ans2 =The day of the month associated with %v2
Ctl.Ans3 =The number of days between %v and %v2 (i.e., %v2-%v1)

If the user presses Cancel: %v and %v2 will be blank and
Ctl.Ans1 =Zero
Ctl.Ans2 =Zero
Ctl.Ans3 =Zero

Notes:
In Form2, the "date range" form, it makes no difference the order in which the user selects the dates. When they are presented to your procedure %v will always be the lesser of the two. i.e., %v < %v2

Make your titles short, they have to fit in the title bar of the calendar object and that is a fixed size. A title that is too long will be truncated. The word TITLE is required to precede the "literal" that is your actual title.

X,Y determines the initial placement of the upper left corner of the Calendar object. Once placed, the user can move the Calendar around at will. For more information about X,Y, see notation standards .

When the K option is specified you may select as many dates as you wish. To select, click on a date. To deselect, click on a selected date. When you click OK all of the selected dates go into the named variable separated either by a blank or by the delimiter you specified with the DELIMITER IS clause. Then you can scan them off using the NXT function for blank-delimited scanning or the NXTD function for delimited scanning.

The optional [date [template]] part of the syntax is used to "seed" the calendar. That is, whatever date you specify will cause the calendar to come up with that date showing. If you leave it out altogether or specify 0 (zero) as the seed, the calendar comes up with todays date.

The default template for dates is MM/DD/YYYY and that is the form that dates are returned to you in %v and %v2. If you specify a seed in some other form like YYYYMMDD for example, then you must specify the template YYYYMMDD. Whatever template you specify will cause the selected date(s) to be returned to you in that form. If you want the calendar to come up with todays date and dates to be returned to you in an alternate form then you must specify 0 (zero) as the seed so that you can specify the alternate template.

In the syntax, the template is not surrounded with quotes or parenthises.

























Form1 Calendarwithout the K option invoked with:


CALENDAR %DATE TITLE "Select a Date"
























Form1 Calendarwith the K option invoked with:


CALENDAR/K %DATES TITLE "Select Dates of Choice"
























Form2 Calendarfor a date range invoked with:


CALENDAR %DATE1 %DATE2 TITLE "Select a Date Range"

In each of these Calendars the user can click on any Month to establish that month, click on "Today" to restore the calendar to todays date, use the spinners to adjust the Month or Year. Or you can double-click on the year and enter any year from 1001 to 9999. To make a selection, click on a day.

The basis for the Calendar is the beginning of the last millennium: January 1, 1001. The Calendar is an extrapolation backwards of our current calendar method to that date, that is, it does not take into account the adjustment made in 1582 so that it would track the Sun better. (If you went to sleep on the night of October 4, 1582 you woke up on October 15, 1582. There were people who thought that the Pope had stolen two weeks out of their lives, but that is another discussion.)

There is an old English nursury rhime posited by A. E. Bray in 1832 that goes:

Mondays child is fair of face
Tuesdays child is full of grace
Wednesdays child is full of woe
Thursdays child has far to go
Fridays child is loving and giving
Saturdays child works hard for a living
And the Child born on the Sabbath day
is bonny and blithe and good and gay

It is interesting to see what a prognosticator that is for the millenniums. The last millennium, January 1, 1001 began on a Thursday - "Has far to go." That seems pretty accurate. The next millennium January 1, 2001 begins on a Monday - "Fair of Face." We think that is auspicious.

To see an example of a Calendar in action, try REPORTS/REVENUE/6 in the EXAMPLE data base.

Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.