Print Page | Close Window

CXTPPropertyGridItemDate doubt

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=14909
Printed Date: 22 November 2024 at 12:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPropertyGridItemDate doubt
Posted By: znakeeye
Subject: CXTPPropertyGridItemDate doubt
Date Posted: 05 August 2009 at 9:37am
XTP 13.1.
 
I don't like the initialization of "m_strFormat".
void CXTPPropertyGridItemDate::Init(const COleDateTime& oleDate)
{
    m_nFlags = xtpGridItemHasComboButton | xtpGridItemHasEdit;
    m_strFormat = _T("%d/%m/%Y");
}
 
That's not the desired format on many platforms! Instead, you usually want to format like this:
date.Format(VAR_DATEVALUEONLY)
 
 
This is not possible with your current implementation. I suggest you make this the default.


-------------
PokerMemento - http://www.pokermemento.com/



Replies:
Posted By: znakeeye
Date Posted: 11 August 2009 at 6:54am
It's a bug!
 
return oleDate.Format();
should be
return oleDate.Format(VAR_DATEVALUEONLY);
 
Otherwise the formatting is erroneous. E.g. with my Swedish setting the date should be formatted as YYYY-mm-dd, but with your code I keep getting YYYY/mm/dd.


-------------
PokerMemento - http://www.pokermemento.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net