This is weird... MODx plays with dates stored in Template Variables.
check out this Snippet code:
if( $TVarray = $modx->getTemplateVarOutput(array(’releasedate’), $modx->documentIdentifier,$published=$modx->documentObject[’published’]) ){
//If TV is not empty, assign value to $pageContents
if(!empty($TVarray[’releasedate’])) {
$pageContents[’releasedate’] = $TVarray[’releasedate’];
}
}
$output = $modx->parseChunk(’mychunk’, $pageContents, ’[+’, ’+]’);
return $output;
Chunk ’mychunk’ has a placeholder: [+releasedate+]
Which ends up printing:
’WEDNESDAY, SEPTEMBER 30, 2009’
Yet, it’s not like that in the database. For the record:
mysql> select value from site_tmplvar_contentvalues WHERE contentid='418' and tmplvarid='22';
Returns:
30-09-2009 15:32:01
The culprit? The Date widget.
TV is using widget Date Formatter with these values:
%A, %B %d, %Y
But those aren’t the correct placeholders. According to
http://www.php.net/manual/en/function.date.php %A should be "AM or PM" not the full day name.
Am I going senile?