Deek
Member
I'm creating a little admin section that is a text box and a date picker. Here is the field for the date picker:
When I include {$item.effectiveDate} the date picker defaults to today and no matter what I change it to it will not update when I save because the value attribute will retain the timestamp (value="1411686000"). I noticed in other places in XenForo where the date picker is used the value will become blank but for some reason mine doesn't follow that behavior.
If I do not include {$item.effectiveDate} in the value I can update the item but there is no way to show what it is currently set at. The other two fields title and text always seem to update. Any idea what I'm missing?
HTML:
<dl class="ctrlUnit">
<dt><label for="ctrl_effectiveDate">Effective Date:</label><dt>
<dd>
<input type="date" name="effectiveDate" value="{$item.effectiveDate}" class="textCtrl" id="ctrl_effectiveDate" />
</dd>
</dl>
When I include {$item.effectiveDate} the date picker defaults to today and no matter what I change it to it will not update when I save because the value attribute will retain the timestamp (value="1411686000"). I noticed in other places in XenForo where the date picker is used the value will become blank but for some reason mine doesn't follow that behavior.
If I do not include {$item.effectiveDate} in the value I can update the item but there is no way to show what it is currently set at. The other two fields title and text always seem to update. Any idea what I'm missing?
Code:
CREATE TABLE `item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(75) NOT NULL DEFAULT '',
`text` text NOT NULL,
`effectiveDate` int(10) unsigned NOT NULL,
PRIMARY KEY (`item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
Last edited: