Results 1 to 9 of 9

Thread: Tasks not showing correctly on calendar

  1. #1
    frontstrat is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    24

    Question Tasks not showing correctly on calendar

    We seem to be having an issue when entering Tasks. When I enter a task with a due date of 12/15/2010 at 8:00 am, the task shows on my calendar on the 15th, but at 2:00 am.

    Any ideas how to fix this? It seems to be system wide with all users.

    Thanks,
    Kevin

  2. #2
    frontstrat is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    24

    Default Re: Tasks not showing correctly on calendar

    I should have mentioned this issue showed up when we upgraded to 6.1.

  3. #3
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Tasks not showing correctly on calendar

    Hello,

    I stand your point, and yes, it can be called as a bug for version 6.1. I changed function get_time_start in file modules/Calendar/DateTimeUtil.php and changed function CalendarActivity in file modules/Calendar/Calendar.php from 6.0 into 6.1.

    It solved the issue but dont know if it is the only way we can solve this issue. Hope to hear from Sugar Team member.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  4. #4
    ehansen20 is offline Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Angry Re: Tasks not showing correctly on calendar

    I too am having the same issue. Using 6.1 and creating a task, in the calendar it's showing 7 hours earlier. My Time zone is set to MST -7. Wondering if that has something to do with it?

  5. #5
    msshahanshah is offline Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Default Re: Tasks not showing correctly on calendar

    well is there a fix to this problem ?
    something like this issue was their in ver 5.0 but a simple php fix is available but for ver 6 no one has any idea !
    any suggestions are welcome.

  6. #6
    unclebuck is offline Sugar Community Member
    Join Date
    Sep 2010
    Location
    Chicago, Illinois USA
    Posts
    23

    Default Re: Tasks not showing correctly on calendar

    We are having the same issue since we upgraded to CE 6.1.0 our tasks are showing up in the calendar view 5 hours earlier. Example task created with start time 8AM CST. When you look at the calendar the task displays in the calendar as starting at 3AM. Has anyone figured out a fix or is there an update? How would I modify the two php files indicated above? What do I look for to change? From what to what?

  7. #7
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Tasks not showing correctly on calendar

    Hello,

    Take backup of modules/Calendar/DateTimeUtil.php and modules/Calendar/Calendar.php then,

    Replace function get_time_start in modules/Calendar/DateTimeUtil.php

    PHP Code:
    function get_time_start$date_start$time_start)
        {    
            
    $match=array();
            
            
    preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/",$date_start,$match);
            
    $time_arr = array();
            
    $time_arr['year'] = $match[1];
            
    $time_arr['month'] = $match[2];
            
    $time_arr['day'] = $match[3];

            if ( empty( 
    $time_start) )
            {
                
    $time_arr['hour'] = 0;
                
    $time_arr['min'] = 0;
            }
            else
            {
                if (
    preg_match("/^(\d\d*):(\d\d*):(\d\d*)$/",$time_start,$match))
                {
                    
    $time_arr['hour'] = $match[1];
                    
    $time_arr['min'] = $match[2];
                }
                else if ( 
    preg_match("/^(\d\d*):(\d\d*)$/",$time_start,$match))
                {
                    
    $time_arr['hour'] = $match[1];
                    
    $time_arr['min'] = $match[2];
                }
            }
            return new 
    DateTimeUtil($time_arr,true);

        } 
    And replace function in modules/Calendar/Calendar.php

    PHP Code:
    function CalendarActivity($args)
        {
        
    // if we've passed in an array, then this is a free/busy slot
        // and does not have a sugarbean associated to it
            
    global $DO_USER_TIME_OFFSET;

        if ( 
    is_array $args ))
        {
           
    $this->start_time $args[0];     
           
    $this->end_time $args[1];     
           
    $this->sugar_bean null;
           return;
        }
     
        
    // else do regular constructor..

            
    $sugar_bean $args;
            global 
    $timedate;
            
    $this->sugar_bean $sugar_bean;


            if (
    $sugar_bean->object_name == 'Task')
            {

                
    $newdate $timedate->merge_date_time($this->sugar_bean->date_due$this->sugar_bean->time_due);
                
    $tempdate  $timedate->to_db_date($newdate,$DO_USER_TIME_OFFSET);

                if(
    $newdate != $tempdate){
                    
    $this->sugar_bean->date_due $tempdate;
                }
                
    $temptime $timedate->to_db_time($newdate$DO_USER_TIME_OFFSET);
                if(
    $newdate != $temptime){
                    
    $this->sugar_bean->time_due $temptime;
                }
                
    $this->start_time =DateTimeUtil::get_time_start(
                    
    $this->sugar_bean->date_due,
                    
    $this->sugar_bean->time_due
                
    );
                if ( empty(
    $this->start_time))
                {
                    return 
    null;
                }

                
    $this->end_time $this->start_time;
            }
            else
            {
                
    // Convert it back to database time so we can properly manage it for getting the proper start and end dates
                
    list($dbDate,$dbTime) = $timedate->to_db_date_time($this->sugar_bean->date_start$this->sugar_bean->time_start);
                
    $this->sugar_bean->time_start $dbTime;
                
    $this->start_time =DateTimeUtil::get_time_start($dbDate,$dbTime);

            
    $this->end_time =DateTimeUtil::get_time_end(
                
    $this->start_time,
                     
    $this->sugar_bean->duration_hours,
                    
    $this->sugar_bean->duration_minutes
                
    );
            }

        } 
    Do let me know if it works!
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  8. #8
    frontstrat is offline Sugar Community Member
    Join Date
    Apr 2010
    Posts
    24

    Default Re: Tasks not showing correctly on calendar

    Modifying the two files above seemed to fix the issue. I will do some additional testing, but at first glance, I added a task at 9:00 am and it showed on the calendar correctly.

    Thanks!!

  9. #9
    ShareAlike is offline Junior Member
    Join Date
    Jan 2008
    Posts
    3

    Default Re: Tasks not showing correctly on calendar

    Yep, Thanks DavidBoris,
    This seems to have fixed the issue for me too. It was a fundamental flaw that made all time/date functions unusable.

    Great work!

    ShareAlike, New Zealand.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 2009-10-20, 04:42 PM
  2. Group Tabs not showing up correctly.
    By clearwater in forum Help
    Replies: 6
    Last Post: 2006-12-21, 12:21 AM
  3. tasks not showing up in the calendar
    By joek168 in forum Help
    Replies: 0
    Last Post: 2005-01-26, 08:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •