Skip Navigation

[Resolved] Change theme for datapicker in CRED

This thread is resolved. Here is a description of the problem and solution.

Problem:
Toolset uses the Lightness theme for the jQuery UI Datepicker. Other themes are available, how can they be used?

Solution:
It is currently not possible because of how the theme CSS is loaded. A request has been filed to facilitate this.

This support ticket is created 6 years, 8 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 10 replies, has 2 voices.

Last updated by Ljuba 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#627580

1) CRED by default use UI Lightness theme and I would like to change it to Flick theme. How to do it?

2) How to enable free data insertions (typing) in placeholder of datapicker?

#627729

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ljuba.

1 - it's not easy. I've tried, but because of the way the jQuery UI CSS is added by Toolset (injected with JavaScript rather than enqueued as normal) it is not simple to add the CSS for a different theme and ensure that it is added later.

I'm consulting with colleagues to see if it is possible and will get back to you.

2. You can't. If you use the browser dev tools you will see that the visible date field shown on the screen is not the form field which actually updates your Types date field, which is a hidden field. There is some JavaScript which takes what you enter using the datepicker in the visible field and converts it to a unix timestamp which is then inserted into the hidden field and which is what is stored in wp_postmeta.

If you want to have a field where users can type dates directly into a field you could use a simple text field instead of a date field and manage converting it into a timestamp yourself if you require that. You may have issues with users entering dates in an inconsistent format, which is why the Types date field works with the datepicker so that the format is predictable.

#627793

Thanks.
1) Disappointing concept (but not your fault). I'm used to use Formidable Pro where it is available easy to set. Unfortunately, for this project now, I don't have the time to experiment with Formidable Pro and Toolset combination, but in the future, I probably will do it.
2) I get you, but maybe you can help me. In project, I have two issues vs data field:
- It must be used in front-end (CRED), what here in Ecuador mean high level of mistakes vs formatting (so, datapicker is by definition only logical choice).
- There is about 50/50 percent of relatively fresh years and years of around 1500 - 1700 (Spanish conquistadors time), what makes more than very difficult to switch datapicker to several hundred years ago (several hundred clicks - what is obviously out of question).

You obviously 'smell' the problem and exposed it perfectly in your second paragraph.

What to do?

P.S. - Again, with Formidable Pro, I never was faced with something similar (there you can do it - 'out of the box').

#627870

Sorry, I noticed one more issue. Datapicker initial year is 1583 and the Spanish landed in Ecuador at 1531, what place me in obvious problem.

1) So, how to fix initial year to 1531?

#627871

Hopefully, there is no terminology issue. I talk about 'datapicker initial year' (what is 1583) and not about 'datapicker visual initial year' (what is 2018 and that is ok).

P.S. - As it can be scrolled year, issue with 'free insertions/typing' is not so important, but 'theming' (skin) and 'initial year' - yes.

#628363

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ljuba

The queue is extremely busy at the moment and I am getting through tickets as fast as I can. I'll get back to you as quickly as possible. Sorry for the wait.

#628376

OK, I'll wait.

#628721

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, I don't have very good news.

No, it is not possible to change the theme. (Our own fault because of how we add the styling. I have filed a request to change this.)

No, it is not possible to select earlier dates. That restriction comes from a PHP library we use that cannot recognise earlier timestamps.

I started to put together a nice demonstration of how you might use the native input of type='date' which in testing provides pretty good means of entering distant dates, but when I came to test it with an old date from 1482 I found that the 1583 limitation affects not only how dates are entered, but is baked in to the Types date field.

If you try yourself and directly enter a timestamp (generate one at unixtimestamp.com) from a date before then into wp_postmeta for one of your Types date fields you will find that when you view the corresponding post in the backend the date field appears empty.

So—frustratingly, I was about to demonstrate the solution—it turns out that you simply cannot use Types date fields before 1583.

You might come up with alternative solutions such as separate numeric fields for year and month and day, but they won't be dates, just numbers.

Sorry that I have run into a brick wall with this one.

#628846

If you access to website, as it is multisite, you will be able to activate Formidable Pro (have multisite license) and maybe to try to small playarround. Try to create Site frontend form with Formidable and see can it work? Why you and not me? You will do it quickly and I don't know how to connect Toolset fields with form - should to spend time to see how to do it (and I'm already a lot of out of time with all issues - not yet opened all tickets).

I don't have other idea.

#629110

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I accessed your site with the credentials from your thread with Christian, but they are for a regular admin, not a superadmin, so I cannot see the plugins list to activate Formidable Pro. I'll also need to use the ARI Adminer plugin to be able to see how Formidable stores the content in the database.

Also, how do you intend to use this date?

Assuming Formidable Pro can publish posts with a custom date field from before 1583, it might not be possible to output the date very easily, but I won't know until I see how it is stored, and whether Formidable offers any way to output the data itself (e.g. using shortcodes).

#629290

1) Yeap, my bad, you cannot activate it. But let it go.
2) I will close topic and open new if I will be faced with issue for site with data before 1583 (but probably is not bad idea to post it to developers, as in case of some eventual bugs they can take in consideration also this issue and complete rewrite the codes for datapicker - remember - theme and first date - two issues are here found).