Reading the code, I understand that you can't use date_format_date to format a date using a custom format type. Is there any other call I could do in order to get the desired result(i.e. format a date according to a user defined format type)?
Reading the code, I understand that you can't use date_format_date to format a date using a custom format type. Is there any other call I could do in order to get the desired result(i.e. format a date according to a user defined format type)?
Comments
Comment #1
karens commentedYou can create your own format options at admin/settings/date-time and they will be available to use wherever you want.
Comment #3
pinoloSorry for reading so late your reply, KarenS. And sorry for not being clear enough. I try rewording.
What I want to achieve is reuse the custom format types defined through the module UI by calling them in code (say, a template file).
Scenario: I (site admin and theme developer) set up initial custom formats, then I leave it to the webmaster to manage them and possibly modify them, while the template files contain calls to those format.
I may have looked the wrong places, but I didn't find a way to do that.
Comment #4
davidhernandezI think what you want is the content_format() function. It is from CCK. You use it like this:
content_format('field_cckfieldname', $node->field_cckfieldname[0], 'machine_name_of_custom_format')
You send it the name of the field you are referencing, the data, and the name of the format you want.
Comment #5
csc4 commentedDon't know whether the OP wanted content_format() but it was perfect for what I was looking for - thanks!
Comment #6
arlinsandbulte commentedHi,
I am just indiscriminately closing all support requests with no activity for more than 1 year.
If you consider this to still be a valid issue / support request, feel free to re-open.
BUT,
if you are re-opening this issue, please provide specific details on how this issue can move forward.
Thanks.