Hello, guys,
I thought that my issue involved the PHP version my server had installed. I asked the host to upgrade me to 5.3 at least.
This upgrade worked…spottily. I could then get the format to change, mostly, but then I started having issues with the custom fields themselves; I would use the datepicker to choose a date, update the post, and the date would disappear. I would also get a fatal error: “Call to a member function format() on a non-object” on the posts that did have dates attached to the field. When I was lucky, the formats were changed perfectly (using the PHP code suggested on the DatePicker reference page on this site), but in the end I had to set the field to “text” instead of “datepicker” because I couldn’t guarantee success.
@cerulean or others like him/her – I’d definitely check to see what version of PHP your server is running. If it’s below 5.3 the “DateTime::createFromFormat” code won’t work. Upgrade and it might fix your issue!
@elliot, or others – can you point me to a piece of jQuery that you know works to change the datepicker format? And perhaps let me know what I need installed on my site as well (jQuery, jQuery UI, perhaps)?
Many thanks, Matt
Thanks, Elliot-
The link above wasn’t as clear as I was expecting, but with the help of others on the forum I was led to downloading the plugins, and while I did still lose my database completely I was able to get going again.
For those in a similar situation: it’s actually a lot better if you find yourself accidentally upgraded to v.4 to NOT try and downgrade. This is possibly what killed my site and custom fields. Elliot is right: on the surface, not much has changed, and most of old code is still supported in v.4 (the use of the repeater field in templates, for example).
If I had taken a breath and found that the only thing necessary to make the new version work is install the add-ons as separate plugins, I would have probably been fine. Don’t do what I did!
@cerulean –
I’m having the same problem…using the code provided in the Date Picker docs but still coming up with “20131111” as a display format, for example.
Your code above looks fine to me; it’s very similar to what I’ve been trying. Did you have any luck finding a solution?
M
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.