Date Picker should display on date

mahesh babu - October 31, 2009 - 05:45

Dear supporters,

Im newbie for drupal, here i have a requirement like i need to display date picker with a text box, beside that text box i need to display a calender icon so that when we click on calender icon the calender should popup after that when we select a date from that calender we need to display that in the text box.

For this I have downloaded Date API module and enabled the calender module, after that in our module while constructing the form i have placed '#type' => 'date_popup' then it is showing date textbox as well as time textbox also. It is fine but i need only the date textbox beside that a calender icon should come. Will this possible? Is there any setting to do this? If so can u please suggest.

Thanks in advance.

I am also interested in this

Vako - November 21, 2009 - 05:37

I am also interested in this feature.

=-=

VM - November 21, 2009 - 05:57

As far as I can tell what is being asked for is already available in the date.module ? There is a date popup module included.

I also found an option with

Vako - November 21, 2009 - 16:17

I also found an option with jQuery UI DatePicker widget, if jQuery UI module is enabled. I will also try the date.module.

First you are going to have

adamsohn - November 22, 2009 - 03:49

First you are going to have to go here /admin/settings/date-time/formats/add and add a custom format string. The php manual link will show you some options. They have lots of good examples on the php site that is linked there. For example:

F j, Y, g:i a               // March 10, 2001, 5:16 pm
m.d.y                      // 03.10.01

You can see how it will look here /admin/settings/date-time/formats/custom. Then go here /admin/settings/date-time/formats and create a new format type name at the bottom of the page. When the page reloads use the drop down box to select you new date format with the time in it. I assume you allready have a date field added to the content type in CCK. Go to /admin/content/node-type/event/fields/field_event_date (I have a node type event and a field call 'field_event_date'. You need to change those for your node type.). In the admin -> content types -> event(content name) -> manage field -> field_date (field name) change the input format in the input format drop down box to the newly create date format without the time in it.

Walla, no more time input field. You also need to make sure that the teaser and full view fields are configured correctly in the display fields page at /admin/content/node-type/event/display .

One more thing. To erase the time (if you ever use it) press del. Took me forever to figure that one out.

Thank you Adam for the detail

Vako - November 24, 2009 - 04:35

Thank you Adam for the detail information. I haven't tried it yet, but soon...

 
 

Drupal is a registered trademark of Dries Buytaert.