We have a Repeatable Group of fields for the Tour Itinerary Days on a Tour Planning system we are developing.
The first field in the repeatable group is the Itinerary Day and we have this set as a Date field, with the standard calendar picker.
However it is rather slow to enter dates, as you first have to select the Year, then the Month and finally the day. This is OK for the first day, but some of the tours are very long with many days.
Is there a way, that having selected the date for the first day of the tour, when you enter the second day and so on, the calendar date picker 'remembers' the first day entered, which means you only have to select the day.
So, lets assume the first day is Thursday 14 July 2022, when you enter the second day in the tour, the calendar would already be set for July and 2022 and all you had to do was very quickly click on the 15th.
Many thanks
Hello,
There isn't such kind of built-in feature within Toolset plugins, when you open a blank date picker, it should be current day.
In your case, you might consider other custom codes, it needs to get previous date value from Repeatable Group item, and setup the default value of datepicker, but according to our support policy we don't provide custom codes support.
Toolset is using jQuery UI datepicker to setup the custom date field, here is the document about "jQuery UI Datepicker":
hidden link
For your reference.
You can also check it with our Toolset contractors:
https://toolset.com/contractors/
Hi Luo
Thank you for your advice.
How can we keep the custom field as a 'date' (for future filtering) and remove the date picker icon and functionality and add the date manually (like as if it was a text box).
Tried a few options from on Toolset forums and none of them seem to be working with the current versions of WordPress and/or toolset.
So, thats
1) Remove/hide little calendar icon
2) Allow a date field to have a manual entry
Many thanks for your help.
Kind regards
Ade
Toolset custom date field stores value in timestamp format:
hidden link
I don't think it will be easier for your user to input the timestamp value
Both your request above is not available within Toolset plugins, you can submit a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.
As a workaround, you can create another single line field, for example "my-text-date", when user create/edit the post, fill value into field in string format, save the post, use WP action hook save_post to trigger a PHP function:
https://developer.wordpress.org/reference/hooks/save_post/
In this custom PHP function, get the value from field "my-text-date":
https://developer.wordpress.org/reference/functions/get_post_meta/
Turn the value into timestamp format:
hidden link
And save it into your custom date field
https://developer.wordpress.org/reference/functions/update_post_meta/
for your reference.
My issue is resolved now. Thank you!