Jump to content

AtkDateAttribute: Difference between revisions

From NusaATK
New page: {{attribute}}
 
Guri (talk | contribs)
Added info on internal representation and parseStringValue method
Line 1: Line 1:
{{attribute}}
{{attribute}}
Note that ATK uses an internal format for storing data in attributes. The date attribute stores the date value in an array with the 'year', 'month' and 'day' elements.
To convert a string value to the internal representation, e.g. when setting an initial value, use the attribute method parseStringValue.
<syntaxhighlight lang="php">
  $attr = $this->getAttribute("orderdate");
  $record["orderdate"] = $attr->parseStringValue("2010-01-09");
</syntaxhighlight>

Revision as of 05:50, 9 January 2010

Attribute: atkDateAttribute

API docs | Flags

List of other attributes

atkDateAttribute screenshot

Note that ATK uses an internal format for storing data in attributes. The date attribute stores the date value in an array with the 'year', 'month' and 'day' elements.

To convert a string value to the internal representation, e.g. when setting an initial value, use the attribute method parseStringValue.

  $attr = $this->getAttribute("orderdate");
  $record["orderdate"] = $attr->parseStringValue("2010-01-09");