ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to Format a Date Custom Field

July 03, 2012 5:04pm

Subscribe [4]
  • #1 / Jul 03, 2012 5:04pm

    vgc

    45 posts

    Hello,

    I am listing courses and one of the custom fields is the date and time. I set the Field Type as Date. To format the output I am using

    {course_date_and_time format="%D, %F %d, %Y - %g:%i"}

    But I get this error

    Fatal error: Unsupported operand types in /mypath/expressionengine/libraries/Localize.php on line 206

    Can you please help? Thank you!

  • #2 / Jul 03, 2012 10:58pm

    Enviromed

    375 posts

    What version of ee are yoiu using/  Are you using Low variables?

  • #3 / Jul 04, 2012 5:46am

    vgc

    45 posts

    EE 2.5.2, and no, I am not using Low variables.

    Thanks!

  • #4 / Jul 04, 2012 6:28am

    e-man

    1816 posts

    Does it work if you remove the - or : ?

  • #5 / Jul 04, 2012 7:47am

    vgc

    45 posts

    I even tried it like this with same result.

    {course_date_and_time format="%D, %F %d"}
  • #6 / Jul 04, 2012 9:35am

    e-man

    1816 posts

  • #7 / Jul 04, 2012 10:01am

    vgc

    45 posts

    They are correct. 😊

  • #8 / Jul 04, 2012 5:21pm

    Dan Decker

    7338 posts

    Hi vgc,

    I tested this in ExpressionEngine 2.5.2 using the standard Date field-type. I set the field to both localized and fixed and did not receive the error.

    {my_date format="%D, %F %d, %Y - %g:%i"}

    Do you have anything else that could be affecting this? Other add-ons or field types?

    Cheers,

  • #9 / Jul 05, 2012 3:17pm

    vgc

    45 posts

    As a matter of fact I am using RogEE Category Sorted Entries, I will try the date outside of that and see if I lose the error.

    Thank you.

  • #10 / Jul 06, 2012 11:02am

    Shane Eckert

    7174 posts

    Hey vgc,

    Please let us know how that goes!

    Cheers,

  • #11 / Jul 06, 2012 3:31pm

    vgc

    45 posts

    Well, I did a test both within and outside of RogEE Category Sorted Entries and it worked fine both ways. I really don’t know what I did differently.

    I abandoned using the date field anyway and made a manually entered date as the time of day was a range.

    Thanks for your help!

  • #12 / Jul 06, 2012 3:34pm

    Shane Eckert

    7174 posts

    Hey vgc,

    Thanks for letting us know!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases