Results 1 to 5 of 5

Thread: Date format error

  1. #1
    maxime.lambert is offline Senior Member
    Join Date
    Apr 2009
    Posts
    24

    Unhappy Date format error

    Hi,

    I don't understand why SugarCRM displays dates in two different format. It's better to look at these screenshots (from the same screen Contacts - DetailView)... First format is yyyy-mm-dd and second is dd/mm/yyyy. The first field corresponds to a custom field, and second one is 'date_entered' field.

    Thanks...
    Attached Images Attached Images   

  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: Date format error

    Hi Lambert

    What is the SugarCRM version you are using?
    What is the date format for user you using?

    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
    maxime.lambert is offline Senior Member
    Join Date
    Apr 2009
    Posts
    24

    Default Re: Date format error

    Hi andopes,

    SugarCRM version is 5.2.0c and this is my config.php file :
    Attached Images Attached Images  

  4. #4
    maxime.lambert is offline Senior Member
    Join Date
    Apr 2009
    Posts
    24

    Unhappy Re: Date format error

    Hi,

    Actually, the first field (format yyyy-mm-dd) is a custom field, while the other one is not.
    This is my detailviewdefs.php file :

    PHP Code:
    ...
    => 
    array (
      
    => 
      array (
        
    'name' => 'birthdate_c',
        
    'label' => 'LBL_BIRTHDATE',
      ),
    ),
    ... 
    Can someone help me ?

    Thanks...

  5. #5
    michel.d is offline Member
    Join Date
    May 2009
    Posts
    17

    Default Re: Date format error

    Hi!
    I'd be glad to find an answer to this problem i'm working on with Maxime.

    I give some additionals details in order to understand the problem:

    Any original Sugar date field is correctly displayed in dd/mm/yyyy format, although the value in database is formatted in yyyy-mm-dd.
    In contrary, our custom field date_c is displayed directly in database format.

    I guess that there is something to do before display to get the same result for our custom field.

    Our vardefs file looks like that:
    PHP Code:
    $dictionary["Module"]["fields"]["date_c"] = array (
        
    'required' => '0',
        
    'source' => 'custom_fields',
        
    'name' => 'date_c',
        
    'vname' => 'LBL_DATE',
        
    'type' => 'date',
        
    'massupdate' => '0',
        
    'default' => NULL,
        
    'comments' => '',
        
    'help' => '',
        
    'importable' => 'true',
        
    'duplicate_merge' => 'disabled',
        
    'duplicate_merge_dom_value' => '0',
        
    'audited' => 0,
        
    'reportable' => 0,
        
    'id' => 'Moduledate_c',
        
    'custom_module' => 'Module',
    ); 
    And e.g. the field birthdate in Contacts:
    PHP Code:
    'birthdate' =>
            array (
                
    'name' => 'birthdate',
                
    'vname' => 'LBL_BIRTHDATE',
                
    'massupdate' => false,
                
    'type' => 'date',
                
    'comment' => 'The birthdate of the contact'
            
    ), 
    I suppose that custom date fields are processed as String or something like that, but i wasn't able to found where...
    If anybody could help, thanks by advance!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2009-07-13, 08:16 AM
  2. Replies: 1
    Last Post: 2007-12-14, 08:07 AM
  3. Replies: 1
    Last Post: 2007-02-14, 07:28 PM
  4. Date Format error
    By MidNiteRaver in forum Help
    Replies: 1
    Last Post: 2005-08-12, 03:47 AM
  5. Date format
    By Scotweb in forum Help
    Replies: 1
    Last Post: 2004-11-17, 01:17 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
  •