Whenever I edit an existing course, start and end dates for the course and enrollment jump one day ahead. So, the teacher needs to change whatever she needs and then remember to edit the dates to reset them to one day defore the day they jumped to.

All hints are welcome!

Thanks

CommentFileSizeAuthor
#8 classroom-dates-jump-ahead-843000-7.patch484 byteswjaspers

Comments

cesar.brod@gmail.com’s picture

This problem is really bothering us. Is there a way we can help in terms to trace it? Is someone experiencing the same problem? We do not have a problem with other date fields inside Drupal.

Thanks!

pwaak’s picture

This really bothers me as well. I suspect it would be relatively easy to fix, but I have not had the time to stop and look for it.

imobachgs’s picture

Assigned: Unassigned » imobachgs

Hi all,

I guess that it has something to do with your timezone. I haven't had time to take a look on that, but I'll try to do it this week. What timezone are you using?

Thank you!

mrebelo.vqeb’s picture

I have the same problem.

pwaak’s picture

We are in time zone -6 (-5 daylight savings).

For reference, here is my list of date problems:
1. The Starting date and Signup start date both advance by one day when editing,
2. The End date and Signup end date both reset to the current day when editing, and
3. Once Unlimited end date or Unlimited end inscription is disabled, it cannot be re-enabled.

BTW, this module has been easier to use than the organic groups solution I was using before. Thank you.

wjaspers’s picture

Version: 6.x-1.0 » 6.x-1.1
Priority: Normal » Major

Problem persists in 1.1

wjaspers’s picture

Status: Needs review » Active

Found it!

In file: classroom.common.inc
On line: 81

Near:

function _classroom_timestamp_to_form_date($timestamp) {

Replace:

    $timestamp -= _classroom_get_user_timezone();
    $date = explode('/', gmdate('d/m/Y', $timestamp));

With:

    //$timestamp -= _classroom_get_user_timezone();
    $date = explode('/', date('d/m/Y', $timestamp));

Note!
I commented out the user's timezone. I'm not sure why this even set when we're not working with hours or minutes....

Apparently, PHP's gmdate function is throwing this off.
The cause appears to be that "gmdate" cannot handle time zones that fall under daylight savings rules.

EDIT: See patch below...

wjaspers’s picture

Component: User interface » Code
Status: Active » Needs review
StatusFileSize
new484 bytes
imobachgs’s picture

Status: Active » Needs review

Hi jwaspers,

Thank you again :) Hopefully I'll try this patch and I'll commit it during the weekend!

cesar.brod@gmail.com’s picture

Thanks osoh for the attention and specially wjaspers for the fix! Fantastic!

wjaspers’s picture

Any chance this has been tested? If so, could you please commit the patch? Thanks!

imobachgs’s picture

Hi wjaspers,

I'll try to test it as soon as possible.

Thank you!