1970 problem again

Hello implementation of event calendar raise error for year 1970 but when I display Object data but $event->start_date has not value. Have you any idea where can be a problem?

  • Thanks Jan for your work. Not only it fixed my issue with the date but only fixes another problem of transparency I had (the calendar was transparent) when using the plugin Tasks together with Event Calendar. Two issues fixed with the lignes of code!

    Cheers,

    Eric

  • Important- only use THIS

    If you don't use this there will be problems if you turn off plugins using a date picker (like profile manager)

    Replace in "models/model.php" the lines 113 - 118 with:

    if (preg_match('/^[0-9]{1,}$/', $ed->start_date)) {
        $event->start_date = $ed->start_date;
    } else {
        $event->start_date = strtotime($ed->start_date);
    }

    if ($ed->end_date) {
        if (preg_match('/^[0-9]{1,}$/', $ed->end_date)) {
            $event->end_date = $ed->end_date;
        } else {
            $event->end_date = strtotime($ed->end_date);
        }
    } else {
        $event->end_date = $ed->start_date;
    }

  • Hi Jan,

    Is this more like compatibility code for people using the Profile Manager (which has a different date format and interferes with the one used by the event calendar) rather than a bug fix then?

    I'm still happy to put it in, but I want to understand the problem as it does not appear to occur if you are just using the event calendar.

  • Hi Kevin,

    this code is now for people using the Profile Manager and for people don't using the Profile Manager. The selected date can be saved and can be displayed correctly. But when you edit an event, the date can't be loaded. At this moment I'm trying to solve this problem. I think the datepickers overwrite each other.

    Jan

  • Hi Jan,

    Yes, this has been the problem in the past.

    Curverider has put its own official datepicker view in the SVN version of Elgg.

    When that is released, I think all plugins should drop their datepickers if possible and use the official one if available.

  • Hi,

    After applying this fixe, it seems better but i got my date of event 1 day before I set up the real date of the event.

    Since Im using a hostin in US, could it be possible that there is a issue or a timezone convertion performed when the date are red from the DB to the interface, knowing that it was stored in UTC and read may be in UTC - 6 ?

    veikos

     

  • Possibly. I'm assuming that if your server is running in UTC, then any times entered must also be in UTC.

    Elgg has no way of setting an application time different from the server time. This is different than apps like Drupal for example, and has been discussed before as a possible future enhancement.

  • Thanks Kevin for your feedback.

    I hope it will be an improvement in the future.

    Veikos

  • Hi,

    I solved my problem by aligning my "application" TZ with the one of the server in the .htaccess :

    SetEnv TZ <my_timezone>

    Veikos

  • Concerning the 1970 problem and the Profile Manager. It appears you can use both as long as you put the Event Calendar below the Profile Manager in the plugin list and do not use the date picker field type in your user/group profiles.