Skip Navigation

[Resolved] add only Timepicker, without date

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

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

Problem:
I want to add a Time picker field without date.

Solution:
This feature request is already included in our to-do list and we, of course, will take care of it if it's possible.

Each feature request could be handled depending on its priority.
So, please keep watching the Types plugin changelog page to know the newly added features: https://toolset.com/download/toolset-types/#changelog

This support ticket is created 8 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 10:00 - - - - -
- - - - - - -

Supporter timezone: Africa/Cairo (GMT+02:00)

This topic contains 10 replies, has 3 voices.

Last updated by Mohammed 8 years ago.

Assisted by: Mohammed.

Author
Posts
#374041

I am trying to: add only Time picker field, without date.

I visited this URL: https://toolset.com/forums/topic/timepicker-only/

I expected to see: a hour field

Instead, I got: both time and date.

#374048

maybe i can do something like this:
create a php function using cred hooks that pre-set date, and then hide only the date using css.
like in this case: https://toolset.com/forums/topic/auto-fill-parent-field-in-cred-form/page/2/#post-320324

can you help me do that?

#374198

Dear shirlyk,

What kind of Time picker field do you need?
Is it two dropdown menu: one for hour, anther for the minute?
If it is, I suggest you create two custom select fields:
one for hour, anther for the minute

Then use the CRED action hook cred_save_data to save it as what you want:
cred_save_data
Hook to do custom action when post data are saved to database.
https://toolset.com/documentation/user-guides/cred-api/#csd

#374970

hey luoy,
thanks for the help!

i don't understand how to use the hook and why?
also- isn't there a way to "hide" the date field and use only the hour/minuet that is already in toolset?

s.

#375307

Since you are requesting for display only hour field, I think it would be more easier to setup a dropdown menu of hour field within CRED, and with CRED action hook cred_save_data, you will be able to save the data as what you want, but both ways is possible, both needs custom codes, it depends on you,

If you need more assistance for it, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out the problem page URL and CRED form URL, and where I can edit your PHP codes, and which one is the problem custom date field, what value do you want it to be stored into database. I need test and debug it in a live website. thanks

#376393

Could you describe more details for the what you are going to do?
Are you going to setup a custom date field value in database, = today's time stamp value + hours of the select field?

#379232

hey
i want the user to add "opening hours" for his listing (cpt). each listing can have many opening hours.
so i want to have a custom field name "time", for example. it will contain a dropdown for hour and a dropdown for minuets. i don't need the date at all.

when i tried to add the code to the custom function in PHP - my site went down...
can you write me the proper code i need to put in the function.php?

thank you 🙂

#379410

I just tested the credentials you provided in private detail box, it does not work any more, I get this error:
Invalid email or username entered

So I tested it in my localhost, if I use CSS codes to hide the datepicker of custom date field, it will not store the value into database even I choose any options in hour's dropdown and Minute dropdown, so there isn't any way to to "hide" the date field and use only the hour/minuet that is already in toolset.

Since you need multiple instance field, in your case, I suggest you try with our document:
So I suggest you try with our document: Creating Groups of Repeating Fields
https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/

1) Create a child post type "open-hour",
2) Add two custom select dropdown fields to the post type "open-hour":
a) Hour (0~24)
b) Minute (0~59)

Then you will be able to setup them in admin side, and display them in front-end:
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/

#379617

thank you.
when i display the parent cred- is it possible to show also the child-post-type fields in the same page?
for example: the user edit a cred with general info about his listing. also- he can edit the hours fields (which is a child post).

thanks!

#379715

Unfortunately, according to W3C form within form is not allowed, so it is not possible to show also the child-post-type fields in the same form, I add the "only Timepicker, without date" into our to-do list as a feature request, our developers will take care of it, but there isn't any ETA for it.

#379762

Hello Shirlyk,

We've included this feature in our internal queues as a feature request and to be honest, I don't have an accurate information about when this would be implemented.

I'm closing this ticket since this feature request is already included in our internal queues and you always can follow the Types plugin changelog page: https://toolset.com/download/toolset-types/#changelog to know the newly added features to the Types plugin.

Thanks.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.