<displaydate>

An XMod "processing instruction" that tells XMod to automatically calculate the record's display date, according to the specified attributes. Using this control, you can tell XMod to grab the display date from another control on the form, set the display date to 1 day from today, 3 weeks from today, or a specific date.

 

A record's Display Date and Expiry Date determine if a record will be displayed. XMod will look for records whose Display Date is less than or equal to Today's date and time and whose Expiry Date is > the current date and time. This behavior can be toggled on/off in the "Configure XMod Module" settings page.

 

ATTRIBUTES:

interval

Specifies the type of calculation that XMod will make to determine the date. Valid values are

  • hh - Hours

  • mm - Minutes

  • ss - Seconds

  • d - Days

  • w - Weeks

  • m - Months

  • y - Years

  • ctrl - A form control. The control's name ( the control's "ref" attribute value) must be specified for the "value"

  • date - A specific date. A valid date must be specified for the "value" attribute

value

The expression specified for this attribute varies, depending on the expression specified in the "interval" attribute. If the interval is Hours, Minutes, Seconds, Days, Weeks, Months, or Years, then the expression must be a numeric value that describes the number of (Hours, Minutes, Days, etc.) to add to the current time to arrive at the display date. This number may also be "0" (zero) and may also be a negative number.
(New to version 3.2.9)
The value may also be retrieved from the value of a form control. To do so, use the control placeholder syntax: {controlname}

 

If interval is "ctrl" then value must be a valid name of a control on the form (the value of the control's ref  attribute)

 

If interval is "date" then value must be a valid date.

 

ignoretime

There are times when you may not need the added accuracy of the date/time combination. If this attribute is "true" then the calculations will assume 00 hours (12am). Of course, if you are adding, say, 5 hours, then the display date will reflect 5am.

basedate

Ordinarily, the starting date for all calculations is the current date and time. With basedate you can have XMod perform the calculation from a date you specify. The value of this attribute can be either a valid date or a control value placeholder {controlname} identifying the "ref" of a control that contains a valid date. This attribute is optional.  New to version 3.2.9.

culture

If your form is hosted in one country, but is being used in a different country,, you need a way to tell XMod that dates entered should be interpreted using a specific cultural setting. The culture property allows you to do that. You set it with a locale ID (or LCID) such as "en-GB", "fr", "de", etc.
New to Version 4.0

 

EXAMPLE

These examples assume the form is submitted on 8/31/2004 at 1:00:00 pm:

 

<displaydate interval="hh" value="1" />
Result: 8/31/2004, 2:00:00 pm

 

<displaydate interval="mm" value="1" />
Result: 8/31/2004, 1:01:00 pm

 

<displaydate interval="ss" value="1" />
Result: 8/31/2004, 1:00:01 pm

 

<displaydate interval="d" value="1" />
Result: 9/01/2004, 1:00:00 pm

 

<displaydate interval="w" value="1" />
Result: 9/07/2004, 1:00:00 pm

 

<displaydate interval="m" value="1" />
Result: 9/30/2004, 1:00:00 pm

 

<displaydate interval="y" value="1" />
Result: 8/31/2005, 1:00:00 pm

 

<displaydate interval="date" value="12/15/2004" />
Result: 12/15/2004, 12:00:00 am

 

<displaydate interval="ctrl" value="txtDisplayDate" />

If the text box control contains: "8/31/2004" then
Result: 8/31/2004, 12:00:00 am

 

<displaydate interval="d" value="txtNumberOfDays" />

If the text box control contains: "5" then
Result: 9/05/2004, 1:00:00 pm