DdsDateFieldTagHelper class | QSYS API Reference Guide

Estimated reading time: 2 minutes

Defines an input element to capture Dates.

Namespace: ASNA.QSys.Expo.Tags Assembly: ASNA.QSys.Expo.Tags.dll

Inheritance: Object –> TagHelper –> FieldBase –> DdsFieldBase

Remarks

Date is a complex data type. It presents several presentation challenges (particularly with respect to Localization). IBM i defined Date Formats in a way that is not common for Web Development.

The use of Selectable Calendar (native on a Web Browser, or Customized by QSys Expo) is very desirable and presents an immediate level of Modernization on a Legacy Application.

The DdsDateField Tag Helper along with the Model definition of the field, provide a very convenient way preserve Application Logic with the IBM i defined Date Formats specification.

The following is an excerpt of a Display Page, with the markup needed to define the layout of a Date:

<div Row="4">
    <DdsConstant Col="23+2" Text="Date:" />
    <DdsDateField Col="29+2" For="SFLC.SORDDATE"  Comment="ORDER DATE" />
</div>

The following is the corresponding Model field definition:

public class SFLC_Model : SubfileControlModel
{
    public List<SFL1_Model> SFL1 { get; set; } = new List<SFL1_Model>();
    .
    .
    .
    [Date(DateFormat = DateAttribute.DdsDateFormat.USA)]
    public DateTime SORDDATE { get; private set; } // ORDER DATE

}

Notice how the DateFormat attribute is defined using the IBM i definition. (The default date-separator is -, it can be changed using DateSeparator attribute).

Properties

Type Name Description
DateAttribute DateFieldAttribute Gets the DateAttribute from the Model.
FieldAttribute FieldAttribute Gets the Date FieldAttribute from the Model.
DdsDayNames FirstDayOfWeek Gets or sets the countries first day of the week.
String MapValues Gets or sets a value that indicates a list of semicolon-separated output value mappings. Format of each mapping is ‘program-value,display-value’.
Boolean UseNativePicker Gets or sets a value that indicates if the Browser’s date picker should be used when capturing a date.

Methods

Signature Description
GetDateFormat() Gets the DateFormat from the Model.
GetDateSeparator() Gets the Date Separator from the Model.

DdsDateFormat GetDateFormat()

Gets the DateFormat from the Model.

DdsDateFormat GetDateFormat()

string GetDateSeparator()

Gets the Date Separator from the Model.

string GetDateSeparator()