Untitled
To view a printable version of this article in a PDF viewer, click here for PDF.
This article describes how the controls in FarPoint Technologies
TM products handle dates. Different controls, and different versions of the same control, may use different algorithms for handling dates within the control. This article consists of these topics:
This paper answers such questions as:
- How do dates get into the control?
- How does the control look at the date data? How does the control save out date data? Do I have options for saving as a different type?
- Does the control try to manipulate the date, such as fitting it into a specified format? If so, how does it do that and what parameters can I specify?
- Can I perform date calculations with the control?
- Does the control make assumptions when given an incomplete date? If so, how does it do that, and what rules can I specify for the assumptions?
- How does the control handle two-digit years?
- What does the control do with invalid dates?
You might want to read this paper if you own or are considering purchasing any FarPoint Technologies' products that handle dates.
For a list of FarPoint products that handle dates, see Which FarPoint Controls Handle Dates?.
We highly recommend that you use four-digit year values for all date values in your data.
This is the best way to ensure that your data is interpreted correctly now and in the future.
Which FarPoint Controls Handle Dates?
This paper divides FarPoint controls that handle dates into two groups: current product releases and previous product releases. For example, Input Pro
TM 3 is a currently released product, while Input Pro 2 is a previously released product.
The following current product releases handle dates:
The following previous product releases handle dates:
Aware/VBX Grid/VBX Input Pro 2 Spread 2.5 Spread 3 |
Spread/VBX Spread/VBX++ Mask Text Control ToolBox (Spread Control) ToolBox (Formatted Edit Controls) |
Return to top
Dates in Calendar ObjX
Calendar ObjX
TM features three custom controls for displaying customizable dates, times, and pictures in your application:
- The fpCalendar control is a fully functional stand-alone calendar that supports different viewing formats and international week numbering.
- The fpClock control lets you provide customized digital and analog clocks in your application.
- The fpPoster control lets you display pictures in your application using optional tinting and washing special effects.
All Calendar ObjX controls support bitmaps, icons, or metafiles.
What part of Calendar ObjX handles dates?
Calendar ObjX's fpCalendar control handles date values. You can specify the date format, appearance, and value. The control is fully customizable; for example, you can provide borders, frames, headers, color, zooming, customized gray areas, and many other features.
How do dates get into the fpCalendar control?
The fpCalendar control receives dates in the following ways:
- Default entry
- User entry
- Database entry
- Programmatic entry
For detailed instructions for using these entry types, see the
Calendar ObjX User's Guide.
Default Entry
When you place an fpCalendar control in your project, the default date value for the control is the current system date (as determined by the Windows Control Panel setting), displayed in a calendar showing a single month. You can change both the default value and the calendar format in numerous ways.
User Entry
The user can select a date in an fpCalendar control to change the value of the control. You can provide navigational tools such as buttons and scroll bars to help the user select a date. You can also allow more than one day at a time to be selected in an fpCalendar control.
Database Entry
In Microsoft® Visual Basic®, you can bind the fpCalendar control to the date portion of date/time fields and to text fields. When the fpCalendar control is bound to a date/time field, only the date portion of the field is updated. You can bind the fpCalendar VBX control to a data control on another form.
Programmatic Entry
You can change the value or values in an fpCalendar control at run time. Calendar ObjX offers numerous functions and properties for changing date values programmatically.
How does the fpCalendar control view date data?
An fpCalendar control views its date value as a string in the format YYYYMMDD, where YYYY is the four-digit year value, MM is the two-digit month value, and DD is the two-digit day value. You can return the value of the fpCalendar control with the control's CurrentDate property.
You can convert a date string value to a date serial value (long integer) using the