[In der nächsten Version behoben] problem with date format in CRED
This support ticket is created vor 8 Jahren, 6 Monaten. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
I am trying to: display the date in CRED form as d/m/Y
I found on the support forums posts from 2013 where people were asking for this feature. It was supposed to be put in the To-do list but it hasn't been implement since then.
It would be nice to have an ETA for this since it is really weird to have the date in a wrong format in a website in French.
As far as I know, the CRED date field inputs display dates by default in the format set in the Date Format in your Settings -> General page, which sets the date format for the whole WordPress site. I agree that it would be nice to have dedicated default options for each form, as a single form might be used on differet languags, for example, each with its own date formtting rules, but by now you should be able to use whatever format you want by just settin git on those global options.
However, I am raising this question against our main CRED developer to see whether we can increase the priority for this. We are sorry of our delay has caused you any issue.
I am also sory that I can not provide an ETA for this at this moment. We are almost closing a development cycle nd we already started testing before releasing, so no new features or requests can make it inro this next version. I will push for evaluating this for the next one, although please note that this is not a promise 🙂
Hi Juan, well it appears that CRED doesn't the Date Format in my Settings General page. And as you say, in Case, the website is multilingual, it would be nice to have the choice on the Date Format.
I confirm that CRED doesn't use the date format used in Settings General page. Please let the developers know that this is a very old situation. So it would be awesome if we were able to chose, or at least be able to have the CRED format the same as the one set is Settings-> general page as it's not the cas for now.
On my website, that are generally in French, the date format is J D Y, and on CRED forms I get D, J Y
Sorry for the delay, I did not get a notification on your answer.
I can confirm that the CRED date fields, as well as Types date fields are set to display their value by default in the WordPress date format set on the Settings General page. This is regardless of the language that WordPress is installed in, as it is stored in an options row in the databse, common to all languages.
But I also see we have a list of valid formats that we accept, and when the one stored there is not among that list, we default to the javascript format 'F j, Y', which kind of matches the one you are mentioning as the one you get.
There is a reason for that restriction on valid formats, since not all PHP date formats (stated in the WordPress settings) can be translated to a JavaScript format to be used here, as the APIs do not match. We can only upport a list of "known" format that can be translated between languages, and also that can be then localized with the datepicker localization layer.
However, as I already said, I am raising this issue with our CRED developer to see whether we can add a format parameter so each date field can have its own structure. On the meantime, I am going to also raise another issue on the list of valid date formats, to see if we can extend it to support at least more combinations of the ones we already do. I think that if we support 'D j, Y', we should also support 'j D Y'. I can not make promises, but such a change should be easy and safe to implement even this late on our development cycle.
Again, sorry for the delay. And thanks for the catch.
hi Juan, sorry, I made a mistake when answering the last time, actually, my settings-> general are set to display date in the format: 'j F Y'.
However, on the CRED Form, the format is still 'F j, Y' so the Date format in my settings is not taken into consideration. Could you help me fix this?
As I stated above, the problem is that CRED fields only support a limited set of date formats, and the one in your settings is not among them. The only fix that we can provide is to add support for more date formats, but that needs to be evaluated and integarted. No workaround for now.
This is already on our to-do list and we will evaluate this soon. However, CRED is over QA for the next release and this request is too late for inclusion. Hope this does not cause you any major problem.
Excuse me but from your previous answers I understood that "the CRED date fields, as well as Types date fields are set to display their value by default in the WordPress date format set on the Settings General page. This is regardless of the language that WordPress is installed in, as it is stored in an options row in the databse, common to all languages."
I'm telling you that this is not the case since the date on the Settings General page is set to display the date in the format "j F Y" and in my case CRED and Types still display the date in the format "F j Y" so it isn't the WordPress date format set on the Settings General page here.
So either CRED doesn't care of the date format on the Settings General page and only consider the date format "F j, Y" or there is a bug here that affects my particular website.
I can consider that for implementing the ability to chose the date format in CRED, the Toolset team needs time. However, it would be important since as far as I know, the team also built the WPML plugin to build multilingual WordPress sites.
But for now, I just would like to know if the fact that CRED (& Types) don't take the date format of the WordPress Settings General page is a bug, or a problem with my particular website or if the Date format is fixed by CRED & Types to F j, Y ? Could you answer this question?
Types and CRED date fields try to follow the format set on the general WordPress settings, but then, once we get that format, we compare it against a list of valid formats that we allow. What we will be doing is expanding the list of formats that we do allow, and then try to provide a shortcode attribute on the CRED field itself to set a specific format there.
As I stated above, the main problem here is that the syntax for date formats is different in PHP and JavaScript, which means that not all PHP date formats can be used with a JavaScript datepicker like the one we have. Because of that, just a small amount of formats will be available.
Now, your speciic format should be among the ones we will support. But we do not support as of now yet. We need to implement it. So it is not actually a bug, but a limitation that we need to expand. And as such, we manage this as a feature request, not a bug.
Ok Juan, now I understand what you mean. I really hope the team will be able to implement this functionality very soon since it's really disturbing for websites in french and other languages too I guess.
I don't change the status of the post to "My issue is resolved" since it's not, but I'll wait for the team to add a proper way to deal with the date format. Moreover since it's really an old request (at least since 2013).
I already filed this as a request for our next development cycle. We are about to release and this will be addressed in the version after that, so it might take a while to have this available to the public.
I am OK leaving this ticket open if you want, but please consider that it will take some weeks at best.
Thank you Juan.
Yes please let this ticket open. I understand that it will take some weeks at best before it's fixed, but keeping it opened would be a way to know that it's a work in progress.