Removing hour, minute, etc. from numeric timestamp


I am setting up a contribution page and am trying to implement the numeric datatype feature to the “date” field in order to have consistently formatted dates. This works fine, but it provides the option for hours, minutes, seconds, and offset by default. I would like to get rid of those options so all that the user sees are the options for year, month, and day. Is this possible? If so, how would I go about doing that?

Alternatively, are there other ways to ensure that the date field will always be inputted in the same format?

Thank you!

Try adding the following to your theme’s CSS file:

.numeric-toggle-time {
    visibility: hidden;

Still very new to this so apologies for the potentially basic question, but I went to the style.css file in default/asset/css directory and added what you suggested. I don’t see any changes. I’m suspecting this is the wrong place to add it. Could you tell me which file to add it to? I am only using the basic theme currently.


You say you’re setting up a contribution page. I assume you mean that you’re setting up a collecting form on your public site via the Collecting module. Is this correct? If so, then the themes/default/asset/css/style.css file should work. You should not be seeing time toggle.

Yes, you’re exactly correct. I think my initial question wasn’t clear enough. You’re right that the toggle isn’t there anymore, but I was hoping to entirely remove the dropdowns for hour, minute, second, and offset.

Do you see those dropdowns? They should be invisible by default, which is why my solution was to make the toggle invisible as well.

I do see the dropdowns. Your solution makes sense in that case, but when I tried to implement it, it just removes the checkbox and leaves the dropdowns. Is there somewhere to check the default case for the checkbox?

It’s strange that the time inputs are visible when the page is loaded. Not sure what’s going on there. Even so, try this:

.numeric-toggle-time, .numeric-time-inputs {
    visibility: hidden;

That did it! Thank you so much for your fast and clear help! I really appreciate it.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.