First of all:
Please excuse my uggly english - I’m writing from Germany (Dresden).
My nickname is not acceptable!
I’m just arrived to this community - thank you, to let me in!
But I wonder why the robot had problems with my nickname “ejomi”
which is pretty unique - only “ejomi-1” works - why?
However, now I’m here and - may be - can do a bit more in future.
How about the german community?
I’m working as webdesigner nearly 20 years but never heard of MODX before
how unlucky! Now I’m playing arround with it since a couple of weeks and
be very impressed. I wonder why MODX is so uncommon in the german environment.
MODX is incredible - I love it!!!
It seems, that the german MODX-forum is dead and unfortunately I did’t find
no german section within this new MODX-forum. Is there something planned?
OK - let’s come to substance:
During my playtime I found the system-tv’s “createdon”, “publishedon” and “editedon”.
They can be formattet like [[*createdon:strtotime:date=%Y-%m-%d]] - fine!
In addition to the post “pdoResources and publishedon Date Formatting” I can report, that unfortunately the “createdon” accepts “%Y-%m-%d” as formatstring
which is NOT correct for the PHP date but PHP strftime functionality!!
The following should work with the system format string - but doesn’t:
[[*createdon:strtotime:date=[[++manager_date_format]]]].
This is why: The systemkey “manager_date_format” accepts the format string “Y-m-d”
which is absolutely PHP-conform but - as I said - not capable for “createdon”!
Those are my 3 paragraphs for the beginning. Hopefully hearing from you: a nice day to you all!
As far as the German Community goes, it is also present in this forum
I have never used the german forum though as this one is the main spot for all the highly knowledgeable people around this CMS, which I wouldn’t want to miss out on. Also it’s very likely that any problem has been discussed here before already. And all the docs and everything else are most likely available in english. The only barrier therefore is the language, which is a personal preference I guess…
… thank you for your quick reply.
This means: The trick, using [[++manager_date_format]] will never work because the date string there is defined like “Y-m-d”.
OK - it’s not that tragic: so we have to insert the format string manualy ("%Y-%m-%d) but everybody should know about this problem. Anyhow: Considering multi language support I think this should be corrected some day to have the functionality of dynamic format changes using [[++manager_date_format]].
Have a nice day - greetings from Dresden (Saxonia, Germany):
ejomi
If it’s for the current resource, I would be inclined to do it with a custom, two-line snippet called MyCreatedOn with this code. It would be much faster since MODX doesn’t have to parse the tag and call the various output modifiers. It also avoids the unnecessary call to strtotime().
/* Get timestamp */
$createdOn = $modx->resource->_fields['createdon'];
/* Format and return value */
return date($modx->getOption('manager_date_format'), $createdOn);