When entering a repeat rule, see this screenshot, I specify that I want to end on the 6th. It works but when you view the entry it says that it is until the 7th, screenshot. When you edit the node you also see that the time stored is the 7th.

Thanks for looking into this. I am using PHP 5.3.3 and here is the content field that I am using.

$content['fields']  = array (
  0 => 
  array (
    'label' => 'When?',
    'field_name' => 'field_res_date',
    'type' => 'datetime',
    'widget_type' => 'date_popup_repeat',
    'change' => 'Change basic information',
    'weight' => '31',
    'default_value' => 'now',
    'default_value2' => 'blank',
    'default_value_code' => '',
    'default_value_code2' => '+30 minutes',
    'input_format' => 'Y-m-d H:i:s',
    'input_format_custom' => '',
    'year_range' => '-1:+3',
    'increment' => '30',
    'advanced' => 
    array (
      'label_position' => 'above',
      'text_parts' => 
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'label_position' => 'above',
    'text_parts' => 
    array (
    ),
    'description' => '',
    'group' => false,
    'required' => 1,
    'multiple' => 1,
    'repeat' => 1,
    'todate' => 'required',
    'granularity' => 
    array (
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
      'hour' => 'hour',
      'minute' => 'minute',
    ),
    'default_format' => 'short',
    'tz_handling' => 'site',
    'timezone_db' => 'UTC',
    'repeat_collapsed' => '0',
    'op' => 'Save field settings',
    'module' => 'date',
    'widget_module' => 'date',
    'columns' => 
    array (
      'value' => 
      array (
        'type' => 'datetime',
        'not null' => false,
        'sortable' => true,
        'views' => true,
      ),
      'value2' => 
      array (
        'type' => 'datetime',
        'not null' => false,
        'sortable' => true,
        'views' => false,
      ),
      'rrule' => 
      array (
        'type' => 'text',
        'not null' => false,
        'sortable' => false,
        'views' => false,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '32',
      'parent' => '',
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      5 => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);

Thank you
Daniel

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Exploratus’s picture

I am having this same problem since upgrading to 2.6 - i was hoping 2.7 would resolve, but no. Basically, when we add an event with a repeat until date everything works fine on the initial save. After saving the node, and going back in the until date shifts up one day - so if the until date was the 27th of Dec it will become the 28th of December. Saving the node and opening it again does it yet again, making it then the 29th. So someone who is not paying attention can move the until date up one day every time the node is saved if they do not manually set it back one day.

This means every time i edit a node, I need to remember to set the until date back 1 day. This is really a big problem.

This is automated, when opening the node to edit, the until date already shows +1 day on the until date every time.

I think the same thing is going on with the person above. He saves a node to repeat until the 6th and it works. Then when he opens the node and saves, it says 7th.

Exploratus’s picture

I tried using an existing field or a new field, no matter - every time i have a repeat until date and open an existing node, the until date shifts +1 day. So if someone opens and saves 5 times, the until date will shift over 5 days.

I am using no time zone conversion, tried date, datetime, and datestamp.

I also tried granularity with hours or without and no matter - every time i save a node with an existing until date, it shifts over +1 day when i open to redit and save.

Exploratus’s picture

I checked on the database and when i create a node it inputs the date fieeld:

2011-01-07 00:00:00 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110109T095959Z;WKST=SU
2011-01-08 00:00:00 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110109T095959Z;WKST=SU

As you can see, the until date is 20110109 - so when i go back and edit the node - it pulls that date. Once i save it becomes:

2011-01-07 00:00:00 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110110T095959Z;WKST=SU
2011-01-08 00:00:00 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110110T095959Z;WKST=SU
2011-01-09 00:00:00 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110110T095959Z;WKST=SU

and so on and so on....

Exploratus’s picture

Is the until date supposed to read the until date or the next date? Because in the example above, even though i put in 2011-01-08, the until date on the database reads 20110109. So my question is, is the until date on the database supposed to read the until date i put in, or it is supposed to say the next day (as it does now) and not count that day.

Right now, Date 2.7 is takign the until date I put (2011-01-08), adding +1 to it and saving it in the database. Then when I reopen an existing node, it pulls that until date (2011-01-09). So if someone doesnt notice and saves it, the until date on the node display become (2011-01-09) and the number on the database becomes (2011-01-10). When I open it again, the same thing happens, adding another +1 day and so on.

Is the database until date supposed to be the until date I put in, or is is supposed to show +1 as it currently does, and then account for it when it pulls the data.

Exploratus’s picture

Does anynody else besides me and dmundra have this issue? I dont want to, but i might have to go back to 2.4 or so. 2.6 and 2.7 both create this problem for me with the until date.

narcissus921’s picture

Component: Date Repeat API » User interface
Priority: Major » Normal

Having same issue with 2.7, 2.6.

Only thing I noticed with the +1 day part is for me, the "Until" field can be up to 5:59pm, but once I hit the 6:00pm mark, it adds an additional day. When left before 6:00pm, the date shows up as the appropriate date.

Exploratus’s picture

This is a pretty critical issue. We cant have date automatically switching our until date every time we open and edit a node. I tried to diagnose, but I ain't that good. Anybody else got any input?

Exploratus’s picture

Component: User interface » Date Repeat API
Priority: Normal » Major

Changing to Major Issue.

Exploratus’s picture

Component: User interface » Date Repeat API
Priority: Normal » Major

#6 - you talking about for the start or end time? Cuz there is no longer a time in the until date.

Exploratus’s picture

Does anybody know how to make the node edit page read on open the date in the db -1 so it doesn't do this anymore.

narcissus921’s picture

I meant with 2.6, the end time field exists. In 2.7, it doesn't. However, I think that time field is part of the problem, though I'm not too great with code to figure that out.

rklawson’s picture

FileSize
1.49 KB

Here's a patch for the Date Repeat submodule that addresses two issues (at least on our installation). First, it prevents the Until date from getting changed to the next day after the one selected. Second, it fixes an issue with the repeating list of dates when an Until value is selected. Previously, the last date in the repeat list would sometimes not include the Until date itself.

This is just a bandage to get things working again and prevent the corruption of data.

perlgal’s picture

I tried the patch in #12 and it worked.

Many Thanks!

chowdah’s picture

Same issue here as #1, and it also happens if I clone a node using date repeat . I'm using Date 6.x-2.x-dev (2011-Jan-03). Tried the patch and it worked for me.

rklawson’s picture

Status: Active » Needs review

This seems to be working for a few of us, so I'm going to change the status to 'needs review.'

KarenS’s picture

Status: Needs review » Fixed

Fixed differently. The calculation function is correct, the problem is elsewhere in the code where there was not enough clarification about when the date was in UTC and when the local timezone.

The RRULE expresses the until date in UTC, that is expected.

chowdah’s picture

So is this fixed in the new dev release 6.x-2.x-dev (2011-Jan-19)?

Status: Fixed » Closed (fixed)

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

dmundra’s picture

Tried the patch and it works. Thank you.

debo7debo’s picture

Version: 6.x-2.7 » 7.x-2.0-alpha4

Can you patch the 7.x version as well. This problem is really annoying.