Results 1 to 5 of 5

Thread: Due date in Tasks module

  1. #1
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Due date in Tasks module

    I'm auto generating tasks via logic hook., I need to set the due date the next day 6pm CST.
    I tried the below code, but it is setting only the 'date' part for due date, 'time' part is always set to 12:00

    PHP Code:
    $today    date("Y-m-d H:i:s"strtotime("now"));
        
    $tomorrow date("Y-m-d H:i:s"strtotime("Tomorrow 6pm"));
        
    $task->date_start $TimeDate->to_display_date_time($today);
        
    $task->date_due   $TimeDate->to_display_date_time($tomorrow); 
    Please advice

    var_dump of variables after above statements are
    Code:
    $today string(19) "2009-11-05 09:06:25" 
    $tomorrow  string(19) "2009-11-06 18:00:00" 
    $task->date_start string(16) "11/05/2009 03:06" 
    $task->date_due string(16) "11/06/2009 12:00"
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Due date in Tasks module

    Inside a logic hook function all date fields are already in database format.
    I hope this help you.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Re: Due date in Tasks module

    yes you are right andopes, thanks, i got it.
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

  4. #4
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Re: Due date in Tasks module

    Now I changed the code to
    PHP Code:
    $today    date("m/d/Y H:i"strtotime("now"));
    $tomorrow date("m/d/Y H:i"strtotime("Tomorrow 6pm"));
    $task->date_start $today;
    $task->date_due   $tomorrow
    Problem is that on task edit screen, start date should display today's time, but it is displaying GMT time.
    Time on my local machine is now 5pm IST, it is showing 11.30am (i guess it is GMT)
    Any idea?
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

  5. #5
    Mithun's Avatar
    Mithun is offline A Prolific Poster
    Join Date
    Mar 2009
    Location
    India
    Posts
    236

    Default Re: Due date in Tasks module

    update:
    running date("m/d/Y H:i", strtotime("now")); in my system is showing 11.30 UTC
    Mithun P Sreedharan
    ITFlux Inc
    38030 Stenhammer Dr
    Fremont
    CA, USA - 94536
    Phone : (510)-792-8897
    Fax : (408)-877-1588
    For further queries mail to mithun@itflux.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Set due date for tasks in workflow possible?
    By karelgeenen in forum Help
    Replies: 1
    Last Post: 2008-08-04, 02:54 PM
  2. Replies: 0
    Last Post: 2007-11-01, 05:28 PM
  3. Can't set due date on Tasks
    By pkirk25 in forum General Discussion
    Replies: 0
    Last Post: 2005-05-29, 08:04 PM
  4. Broken date handling in tasks module
    By insightfulsolutions in forum Downloads
    Replies: 0
    Last Post: 2005-04-20, 04:24 AM

Tags for this Thread

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
  •