1

I tried to implement a time picker for a field opening hours. I used Bootstrap Date & Time picker and I set the FIELD TYPE to date, but I couldn't see any widget for BDT Picker in widget selection.

Then, I used jQuery UI Timepicker. The time picker is showing, but I can select only 0 for hours and 00 for minutes; all other cells are disabled. Also, the default time in the field is the current time.

What could the issue be?

When I select the date field type, the form has a date field with a full calendar. I need a field to pick only the time. How can I do it?

2
  • You can use the date_popup_timepicker module. Commented Aug 17, 2016 at 7:38
  • now i used the same ,but the issues i i can't able to hide the date calendar, i need to show only the time field.Is it possible? It is for a field "Opening Hours".
    – Hari kris
    Commented Aug 17, 2016 at 7:51

1 Answer 1

1

Create a field , select field type as Date (ISO format) or Date. And choose only year, hour, minutes, seconds(if needed). Select Date entry options under MORE SETTINGS AND VALUES , choose custom format as H:i

Add time format for H:i and also go-to admin/config/regional/date-time and add date type (to display in node view). In add/edit page for time picker(only hours)

enter image description here

In view page

enter image description here

Hope this helps you with out any help of other modules.

2
  • Thank you @ajay I want a pop up time picker like bootstrap or anything based on jquery.
    – Hari kris
    Commented Aug 17, 2016 at 7:24
  • You can write custom jQuery popup for particular div/section. Refer jsfiddle.net/moogs/606pgg4o/1
    – Ajay Reddy
    Commented Aug 17, 2016 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.