Jump to:
| Project: | Calendar |
| Version: | 6.x-2.4 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Hi there,
I'm having above issue with a multi day event (date field with no timezone conversion and tested with both a date value and a datetime value). Below some bits and pieces I got from my experiments with an event from 01/01 to 31/12. No idea why this happens for the 31st only and not for the 30th.
(I also mentioned this in http://drupal.org/node/292871, but wanted to bump and separate)
When printing out $node_calendar_start before line 428 and after line 429 in calendar.inc (where date_format is applies), I get the following:
the actual date is set back to a day earlier, this might be intentional ?
2008-07-27 00:00:00
2008-07-26 22:00:00
When printing out $items in calendar_build_month, for e.g. July (a 31 day month) I get the following (I only listed first and last 2):
the first item is still in June and the list only goes up to the 30th instead of the 31st .
Array
(
[2008-06-30] => Array
(
[2008-06-30] => Array
(
[0] => stdClass Object
(
[nid] => 100
[node_data_field_date_field_date_value] => 2008-01-01 00:00:00
[node_data_field_date_field_date_value2] => 2008-12-31 00:00:00
[node_title] => year
[node_type] => agenda
[title] => year
[type] => agenda
[label] => field_date_value
[format] => m/d/Y H:i
[format_time] => H:i
[url] => http://philippe-law/agenda/2008/01/01/year
[datefield] => node_data_field_date_field_date_value
[calendar_start] => 2008-06-30 22:00:00
[calendar_end] => 2008-07-01 21:59:59
[calendar_start_date] => DateTime Object
(
)
[calendar_end_date] => DateTime Object
(
)
[stripe] =>
[stripe_label] => Agenda
[date_id] => calendar:100:field_date:0:0
)
)
)
[2008-07-01] => Array
(
[2008-07-01] => Array
(
[0] => stdClass Object
(
[nid] => 100
[node_data_field_date_field_date_value] => 2008-01-01 00:00:00
[node_data_field_date_field_date_value2] => 2008-12-31 00:00:00
[node_title] => year
[node_type] => agenda
[title] => year
[type] => agenda
[label] => field_date_value
[format] => m/d/Y H:i
[format_time] => H:i
[url] =>
[datefield] => node_data_field_date_field_date_value
[calendar_start] => 2008-07-01 22:00:00
[calendar_end] => 2008-07-02 21:59:59
[calendar_start_date] => DateTime Object
(
)
[calendar_end_date] => DateTime Object
(
)
[stripe] =>
[stripe_label] => Agenda
[date_id] => calendar:100:field_date:0:0
)
)
)
[2008-07-29] => Array
(
[2008-07-29] => Array
(
[0] => stdClass Object
(
[nid] => 100
[node_data_field_date_field_date_value] => 2008-01-01 00:00:00
[node_data_field_date_field_date_value2] => 2008-12-31 00:00:00
[node_title] => year
[node_type] => agenda
[title] => year
[type] => agenda
[label] => field_date_value
[format] => m/d/Y H:i
[format_time] => H:i
[url] =>
[datefield] => node_data_field_date_field_date_value
[calendar_start] => 2008-07-29 22:00:00
[calendar_end] => 2008-07-30 21:59:59
[calendar_start_date] => DateTime Object
(
)
[calendar_end_date] => DateTime Object
(
)
[stripe] =>
[stripe_label] => Agenda
[date_id] => calendar:100:field_date:0:0
)
)
)
[2008-07-30] => Array
(
[2008-07-30] => Array
(
[0] => stdClass Object
(
[nid] => 100
[node_data_field_date_field_date_value] => 2008-01-01 00:00:00
[node_data_field_date_field_date_value2] => 2008-12-31 00:00:00
[node_title] => year
[node_type] => agenda
[title] => year
[type] => agenda
[label] => field_date_value
[format] => m/d/Y H:i
[format_time] => H:i
[url] =>
[datefield] => node_data_field_date_field_date_value
[calendar_start] => 2008-07-30 22:00:00
[calendar_end] => 2008-07-31 21:59:59
[calendar_start_date] => DateTime Object
(
)
[calendar_end_date] => DateTime Object
(
)
[stripe] =>
[stripe_label] => Agenda
[date_id] => calendar:100:field_date:0:0
)
)
)
)Tnx,
HnLn
Comments
#1
OK, upon further investigation I found the following:
When I print out $view at the start of calendar_build_nodes, I get
[max_date_date] => 2008-07-31
for July, a 31day month
and
[max_date_date] => 2008-07-01
for June, a 30 day month
So it might be a views issue ?
Tnx,
HnLn
#2
Not Views, that is put there by the Calendar module. Now we need to back up and figure out why that got mis-calculated. What version of PHP are you using? What timezone is your PHP server using? What is your site timezone? The code shouldn't be doing timezone conversion, but maybe it is trying to somewhere, so I want to get set up as similarly as possible to what you're seeing.
#3
Ok, even more research turns out it's a date issue, something goes wrong in the arg_range date handler. When getting the max date it returns the 31st for a 30 day month AND for a 31 day month.
Not sure this is because the complete_day function throws in the part_info('empty_max') or if this is a timezone issue (I'm in Europe Brussels).
If someone can confirm this is the issue, I'll put this in a a date issue.
HnLn
#4
Hi KAren,
tnx for the reply (I missed your post when submitting my last research results)
php: 5.2.3
php timezone: Europe/Berlin
drupal timezone: Europe/Brussels
HnLn
#5
As mentioned in issue http://drupal.org/node/296345, commenting out the time zone settings in calendar_build_nodes (line 419 - 430) fixes this issue.
Do still think there is a flaw in date as date_days_in_month will return 31 for e.g. June as it will take 31/06 as date argument, it might be interesting to get the range by incrementing date_month and set date_day to 1 and then substract 1 day or 1 second.
HnLn
#6
There's some code in there that is supposed to be checking for the right last day of the month for the month in question, I need to track back through this to see why that's not working.
#7
Thanks for the help, that was just the info I needed. This is fixed, it is actually a bug in the Date module, so the fix is there. Thanks!
I'll leave this issue in Calendar, since that where the effect shows up.
temp
Automatically closed -- issue fixed for two weeks with no activity.
#8
Automatically closed -- issue fixed for two weeks with no activity.
#9
This has reappeared as an issue.
Where is the : calendar_build_nodes (line 419 - 430)?
Using Date 6.x-2.8 and Calendar 6.x-2.4
#10
OK found calendar_build_nodes in the calendar.module. line #604
But the lines have now changed. Any direction as to what lines to now comment out?
#11
I also can confirm that some of my repeating events are missing from the 31st of the month. Interestingly, I have one of three repeating events that does show up on the 31st in month calendar view. It occurs 11am-2pm. The two that are missing occur in the evening - 7pm-8pm and 9pm-11pm. My timezone setting is America/Chicago.
I'm using date 6.x-2.8, calendar 6.x-2.4 and views 6.x-2.16. Any idea on how to resolve this?
#12
I was also experiencing this problem in version 6.x-2.4. It seems to be fixed in 6.x-2.9 the adding of CONVERT_TZ() to the Month View SQL.
For example, the SQL in 6.x-2.4 was
AND ((DATE_FORMAT(node_data_field_event_date.field_event_date_value, '%Y-%m') <= '2012-08' AND DATE_FORMAT(node_data_field_event_date.field_event_date_value2, '%Y-%m') >= '2012-08'))and in 6.x-2.9 is now
AND ((DATE_FORMAT(CONVERT_TZ(node_data_field_event_date.field_event_date_value, 'UTC', 'America/New_York'), '%Y-%m') <= '2012-08' AND DATE_FORMAT(CONVERT_TZ(node_data_field_event_date.field_event_date_value2, 'UTC', 'America/New_York'), '%Y-%m') >= '2012-08'))#13
Fixed according to #12 ???
#14
Automatically closed -- issue fixed for 2 weeks with no activity.