I am using CSLA 3.8 version. In this version I am facing some date time conversion issues with SmartDate.
Host environment has Date format as “DD/MM/YYYY”
Client environment has Date format as “MM/DD/YYYY”.
a. A SmartDate object is created at host for the value “6 July 2013”.
b. The object will store information in string format as “06/07/2013”.
Result: When this object is queried at UI, it will convert string value to datetime type object, which will return “7 June 2013”.
a. A SmartDate object is created at host for the value “26 July 2013”.
b. The object will store information in string format as “26/07/2013”.
Result: When this object is queried at UI, it will try to convert string value to datetime type object, which will return a null value. This will cause an exception at the UI.
a. A business object is using SmartDate type property to save date information to database.
b. Another object is using DateTime type property to get date information from the same database.
Result: Return value will be different from the original one.
To address the same I have modified SmartDate class. I request to support team to review my changes in attached file(rename it .cs) and let me know the changes are not going to crash the framework in any scenario.
I do not agree and we are NOT planning on doing any update on the 3.8.x versions of CSLA.
SmartDate stores its value in a DateTime object (NOT a string) and the default format for convcertion to string is "d" which is the short data format. So it seems that your SmartDate code is modified on your side. Even the SmartDate.cs from 2005 uses a DateTime backing field to store its value and we are talking Csla 2.x version at that time.
So I would rather suggest that you grab the latest SmartDate.cs from CSLA 3.8 .3 and update your own CSLA version.
Copyright (c) Marimer LLC