Still looking to use this module to force entry of multiple single dates, but having multiple values and using the "add another item" button breaks the single date field display.
I have a site where I need to be able to have users enter a span of time as individual dates, both for views display purposes, and for the fact that each date may have different start and end times (ie. for rummage sales that may be open 8-5 one day and 9-2 on another).
I know this is tricky because of CCK's use of AJAX for adding multiple values, but this is something I really need to have for this (and other planned future sites). (Unfortunately I don't have the coding knowledge to contribute myself) Thanks!
Comments
Comment #1
joachim commentedThis is something I have neither the time nor the skills with CCK and FormAPI AHAH to deal with, but let's leave it open and see if another user can contribute a fix :)
Comment #2
thebuckst0p commentedDuplicate comment from #830670:
I did that here, would require a slight change to the module to do the same:
Customizing Drupal date field with hook_form_alter and #after_build
Comment #3
iamer commented@thebuckst0p Taking a hint from your code, I have created a patch that fixes the problem.
Please test :)
@joachim Thanks for your work on this module.
Comment #4
iamer commentedI noticed that I didn't check if the field was set as single day or not. Here's a modified patch. Thanks.
Comment #5
joachim commentedPatch works perfectly, but could you explain what this change is for please?
Comment #6
iamer commentedSorry, I have another patch to handle date popups with repeat options, and this line crept into this patch. I will submit a separate patch for that. Here's a cleaned up patch.
Comment #7
joachim commentedSeems we need more than just date_popup here -- it's not working with just that.
BTW, if you're rerolling this again, could you make sure to use spaces to indent rather than tabs please?
Powered by Dreditor.
Comment #8
iamer commentedOK, another try at this. I looked back at my changes and I had found that the widget type in the ahah callback is actually 'date_combo' , so that is needed.
'date_popup_repeat' belongs to the other patch.
I changed the indentation to spaces. Vim uses tabs by default.
Comment #9
joachim commented#815054 by iamer: Fixed operation with 'add another item' button.
Great work -- thanks for figuring all this out! :D
For future reference, check http://drupal.org/coding-standards for matters of indentation (2 spaces not 4) and things like how to do elseif and braces.