×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    4

    SetTimeFormatStringL does not work.

    In the CreateSettingItemL of my setting list i'm trying to set the time format for my setting item:
    CAknTimeOrDateSettingItem* i = new (ELeave) CAknTimeOrDateSettingItem ( aIdentifier, CAknTimeOrDateSettingItem::ETime, time);
    _LIT(KFormatTimeString,"%-B%:0%J%:1%T%:3%+B");
    i->SetTimeFormatStringL(KFormatTimeString);

    For some reason this just does not seem to work.

    Is it a known bug or should I do something differently?

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    15

    Re: SetTimeFormatStringL does not work.

    I think the best way to accomplish what you're trying to do is to derive your own class from CAknTimeOrDateSettingItem and reimplement the CompleteConstructionL() method from the base class something like this:

    Code:
    class CMyTimeSettingItem : public CAknTimeOrDateSettingItem
    {
    	protected:
    		void CompleteConstructionL();	
    };
    
    void CMyTimeSettingItem::CompleteConstructionL()
    {	
    	CAknTimeOrDateSettingItem::CompleteConstructionL();
    	//See TTime for string format
    	SetTimeFormatStringL( _L("%H:%T:%S") );	
    }

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    1

    Re: SetTimeFormatStringL does not work.

    Quote Originally Posted by Anssi Nurminen View Post
    I think the best way to accomplish what you're trying to do is to derive your own class from CAknTimeOrDateSettingItem and reimplement the CompleteConstructionL() method from the base class something like this:

    Code:
    class CMyTimeSettingItem : public CAknTimeOrDateSettingItem
    {
    	protected:
    		void CompleteConstructionL();	
    };
    
    void CMyTimeSettingItem::CompleteConstructionL()
    {	
    	CAknTimeOrDateSettingItem::CompleteConstructionL();
    	//See TTime for string format
    	SetTimeFormatStringL( _L("%H:%T:%S") );	
    }
    i have test what you said.
    you are very correct!!
    but its format is +HH:MM:SS
    which "+" hasn't been removed

Posting Permissions

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