Hi,

This is a great module. But is it possible to have it for 'Date popup and Repeat Options' too?
Events, which are single day events like classes, but repeat on regular basis at the same time.

Thanks

Comments

thebuckst0p’s picture

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

iamer’s picture

Status: Active » Needs review
StatusFileSize
new1.94 KB

Here's a try at a patch that implements date single day for date_popup_repeat

joachim’s picture

Status: Needs review » Needs work

Not sure what this patch addresses.

Could you explain what this is about please? How do I set up a date field to see the feature this adds?

Some minor code style tweaks needed too. Sorry to be a stickler but I'm at conference and got a million things to work on :)

+++ b/date_single_day.module	2010-08-24 02:54:15.771740478 +0300
@@ -13,7 +13,7 @@
+  $widget_types = array('date_popup','date_popup_repeat');

Space after the comma.

+++ b/date_single_day.module	2010-08-24 02:54:15.771740478 +0300
@@ -50,10 +50,15 @@
+          if ( isset($form[$field_name]['rrule']) ){

No spaces inside the ().

+++ b/date_single_day.module	2010-08-24 02:54:15.771740478 +0300
@@ -50,10 +50,15 @@
+          } else {

Don't coddle an else.

Powered by Dreditor.

iamer’s picture

So the use case is :

* Create date or date time field with repeat options.
* Single day checkbox doesn't appear in the field options.

I would expect it to be able to handle this date time field as usual.

The patch implements that. I will re-roll with code style fixes, at least I got the indentation correctly this time :)

Thanks.

joachim’s picture

StatusFileSize
new2.31 KB

Here's my version of this with code style fixes.

Could you add a comment to explain what this does please?

  if (isset($form['rrule'])) {
    $output .= drupal_render($form['rrule']);
  }

also, explain what is being tested here:

          if (isset($form[$field_name]['rrule'])) {
iamer’s picture

StatusFileSize
new1.94 KB

The date time field with repetition options doesn't have a numeric keyed array like the ordinary date time field. So I detect the existence of the rrule component and add the after build and theme functions on the field.

In the theme function, since you selectively render the field parts, the repetition rule fields are missing and have to be rendered alone.

Thanks.

joachim’s picture

I don't see what's different with your patch.

Could you take mine as a starting point (which has the code style fixes) and add the comments please?

iamer’s picture

StatusFileSize
new2.1 KB

Yeah I wasn't really awake, and I attached the wrong patch. Here's one with the comments.

joachim’s picture

Actually, could you use the widget type instead of rrule for that?
That would be more elegant rather than finding things in the $form.

joachim’s picture

Status: Needs work » Needs review
StatusFileSize
new2.86 KB

Try this.

perlgal’s picture

I applied patch from #10 and it works!! You guys rock!!

Thank you!!

perlgal’s picture

Status: Needs review » Fixed
joachim’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Thanks for testing the patch! :D

Though note for another time -- the status to set if a patch is good is 'Reviewed & Tested by the Community'. Only a maintainer should set it to 'Fixed', once the patch has been committed... which I am doing now :)

#830670 by iamer, joachim: Added support for 'Date popup and repeat options' widget.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.