1970 event date problem still

I am having the 1970 date problem and I cant seem to get around it. I am running 1.8.8 Elgg and initially I activated Event Calendar 0.8. It was posting events correctly albeit not easily because the date menus were running off the page but if you type the date in it worked - only other problem was deprecated in 1.7 error messages.

I then upgraded to 0.85 (earlier version - 6e3d519) with the js calendar datepicker. That displayed fine and worked well except it was giving event date 1 day sooner than the one selected. At this pointI I started reading the discussions and comments to try and fix it. - I'm not running Profile Manager, my event calendar is after profile and I'm not running any other plugin with datepicker. Placed my timezone in php5.ini and made changes in model.php and datepicker.php, changed date to gmdate, all to no avail.

Now I have activated the newest 0.85 from github (75bd3af). Looks really good but now I select the dates from datepicker, all looks good - submit and it comes out with Jan 1 1970 event date and if I have end date it is Dec 31 1969. Tried all of the fixes previously mentioned and cant change the result. Oddly, I can remove 0.85 and re install 0.8 and the dates work correctly as described earlier.

Below is my list of plugins, in order.

Profile 1.8
Blog 1.8
Elgg Developer Tools 1.0
Embed 1.8.1
File 1.8.1
Garbage Collector 1.5
Groups 1.8
HTMLawed 1.8
Invite Friends 1.8
Likes 1.8
Log Browser 1.8
Log Rotate 1.5
Members 1.8
Messages 1.8
Notifications 1.7
OAuth API 1.8
Pages 1.8
Reported Content 1.8
Search 1.8
Tag Cloud 1.0
The Wire 1.8
TinyMCE 1.8
Zaudio 1.8
LiangLee Framework 1.1.3
Liang Lee Panel 1.0.1
Lee's Theme Designer 1.0.0
Friend request 3.2
Friends add not in river 0.1
Mobile 2.0 - BETA
Registration Terms 1.2
3 Column River Activity
User Validation by Admin 1
Who Viewed Me 1.8
Draw 1.0
AU Widgets Framework 1.1
SW Admin Only Widgets for Elgg 1.8 caoper
World Weather Online 0.1
iZAP Elgg Bridge 2.1.2
Google 1.0
izap-diskquota 1.2
IZAP threaded comments 2.1b
Izap facebook pipe 1
Hide Members item in More Menu 1.4
Videos 1.4
Group Tools 2.3
File Viewer 0.21
Market 1.8f
Group Chat 1.8
Group Operators 1.3.2
No distortion for icons 1.8
Login As 1.4
Text Captcha 1.8
Dropdown menu with your groups in topbar 0.3
Enhanced Friendly Time 1.8.2
Tidypics Photo Gallery 1.8.0-rc1
TidypicsExt 0.01
Easy Theme 1.3.1
Widget Manager 4.3
Homepage CMS 1.2
Footer Editor Air
Event Calendar 0.85

Any help is much appreciated.

  •  I have played with changing order of plugins and deactivating plugins to the point of only event calendar is activated. Still same results. Of further note - between upgrading from 0.8 to 0.85 I temporarily added a custom profile field to add members birthday - deleted it as soon as I figured out it wouldnt display a birthday before 1-1-70. Not sure of any effect - but if I reinstall 0.8 it will give correct date after saving.

  • Get the version in:

    https://github.com/kevinjardine/Elgg-Event-Calendar/tree/full
  • Thanks for your reply Kevin. That appears to be the version of EV_0.85 that I am using. I initially upgraded to what must be an earlier version of 0.85 (6e3d519), it did not have the recurring event dates for the full calendar and Blue Button option, I had the problem with date saving as 1 day earlier with that one. I then upgraded to the version you refer to, now getting 1-1-70 on all edits and new events.

    So I did download a fresh version (that is 75bd3af) and tried again today. Same result.

    It's odd that I can deactivate and delete 0.85, upload and activate 0.8 or 0.84 and get the dates to save correctly. Then deactivate and delete that version. Reupload and activate 0.85. the events display correctly but if I try to add an event or do any edit on the existing event the date will be saved as Jan 1 1970.

    Very perplexing....

  • Do you get the same result in several different browsers?

  • Ouch, tunnel vision, got what I deserved..... Yes thanks Kevin. Problem with Firefox 8.0.1 on Intel MAC.

    All is good in FF3.6.28 on PPC MAC, 16.0.2 on Intel MAC, Safari 4.1.3 on MAC PPC, Safari 5.1.2 on Intel MAC and IE8 on Windows PC. Sorry to waste discussion space.

    Thanks for the excellent plugin... and your time

    Rusty

    www.masterkeykenpo.com

  • If someone still have this problem with newest version:

    in model.php find lines, where $event->start_date and $event->end_date are set.

    Then replace fragments like that:

    $start_date_text = get_input('start_date');
    if($start_date_text && isValidTimeStamp($start_date_text)){
    $event->start_date = $start_date_text;
    }
    else{
    $event->start_date = time();
    }

    $end_date_text = get_input('end_date');
    //$event->original_end_date = get_input('end_date');
    if ($end_date_text && isValidTimeStamp($end_date_text)) {
    $event->end_date = $end_date_text;
    //$event->munged_end_date_string = $end_date_text." ".date_default_timezone_get();
    } else {
    $event->end_date = time();
    }

    I've added here function isValidTimestamp, because when you do not choose a date, it will not be set to timestamp, so it will be 1960 year. If user dont choose date - we have an event today. isValidTimestamp:

    function isValidTimeStamp($timestamp){

    return ((string) (int) $timestamp === $timestamp)
    && ($timestamp <= PHP_INT_MAX)
    && ($timestamp >= ~PHP_INT_MAX);
    }