Search Locate Previous Next Contents

Date Entry (DT)


Description
Edit field which expects and assigns dates as numeric scalars. The appearance is picked up from WIN.INI, so formatting information is optional. It operates a simple ‘moving window’ around the century change if you use 2-digit years.

The field has a simple ‘spin’ behaviour, which increments the days, and kicks over the months when required. The string ‘t[oday]’ is acceptable; also the field defaults to {current} when month or year are omitted.

Dates are held as the elapsed days, with 01/01/1900 as day-1. This is the same scheme as Dyalog uses, and allows easy addition and subtraction of dates. Note that 29-1-1900 is NOT a leap year (unlike the Excel bug unless you switch to Excel mode).

Pressing <Enter> with a partial date re-displays it in its complete form. A further <Enter> confirms, and is passed through to the <OK> button if there is one.

Class Property Table
NameTypeDefaultDescription
HintString
StyleManyOf
DateUserDate variable (integer date)
PictureRuntimeDate picture (e.g. ‘dd-m-yyyy’)
EncodingOneOf‘Dyalog’Compatibility mode (Dyalog or Excel)
DelayInt400Initial delay (ms)
IntervalInt50Repeat interval (ms)
TrackingBool1Update data every click
VisibleRuntimeBoolean singleton
ActiveRuntimeBoolean singleton

Class-specific Functions
DayofWeekReturns day of week as 3-element text given ordinal date
SetWindowSet sliding date window (cf 1st element of yy_window)


Continue to: Date Entry – SetWindow Function
© Copyright Causeway Graphical Systems Ltd 2003