Results 1 to 1 of 1

Thread: Sort Calls by time and date

  1. #1
    ChocolateLover is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    14

    Question Sort Calls by time and date

    I'd like to be able to sort the calls by time and date, not just date.

    I thought I'd create a new field that the user doesn't see in view or edit detail.

    When the record is saved I'd like to create a new datetime field out of the start_date and start_time values that I can pull out of the database to use for sorting in list view.

    This is what I've done so far.

    Created a new date field in the Studio for Calls - date_time_start.
    Changed the database type for the field from Date to DateTime in the calls_cstm table.
    Changed 'data_type' => 'date', to 'data_type' => 'datetime', in cache/dynamic_fields/Calls/fields.php
    In modules/Calls/EditView.php I've included
    $focus->date_time_start_c = $timedate->to_db_date_time($focus->date_start, $focus->time_start) ;
    after $focus->date_start and $focus->time_start are set.

    This seems to write a value of 0000-00-00 00:00:00 into the database, when the date_start is 2007-02-01, time_start is 18:30:00.

    Can anyone tell me what I'm doing wrong? Am I passing the dates in the incorrect format to the to_db_date_time function?

    Thanks very much.
    Last edited by ChocolateLover; 2007-02-07 at 10:15 PM.
    SugarSuite 4.5.1
    OSX 10.4.8
    Apache 2
    PHP 5
    MySQL 4

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Order call list by date AND time
    By ChocolateLover in forum Developer Help
    Replies: 1
    Last Post: 2007-08-21, 02:49 PM
  2. Calls dashlet - sort by date AND time
    By ChocolateLover in forum Help
    Replies: 0
    Last Post: 2007-02-06, 06:33 PM
  3. Start date and Time
    By njoy in forum Help
    Replies: 0
    Last Post: 2006-08-21, 04:19 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
  •