R
Raterus
Hi,
I have a business object that exposes a DateTime object to my presentation layer. Usually this is filled with a valid date, but sometimes it is empty (and stored as 1/1/1900 as it is a SmallDateTime in SQL Server). I'm unsure how best to present this to the user, I want no date to appear if it is blank "1/1/1900", but if it is a valid date, show it.
I guess I'm a little confused as to which layer should do this, my first hunch is the presentation layer, since this deals with what the user sees, but then when I think about it, to do this correctly, the presentation layer would have to account for the 1/1/1900 problem, which seems like something the business layer should have to do.
Is there any way I can store a value in a DateTime object, so when I use a ToString method, it returns as "", that would really fix it! Or any other suggestions I might try?
Thanks,
--Michael
I have a business object that exposes a DateTime object to my presentation layer. Usually this is filled with a valid date, but sometimes it is empty (and stored as 1/1/1900 as it is a SmallDateTime in SQL Server). I'm unsure how best to present this to the user, I want no date to appear if it is blank "1/1/1900", but if it is a valid date, show it.
I guess I'm a little confused as to which layer should do this, my first hunch is the presentation layer, since this deals with what the user sees, but then when I think about it, to do this correctly, the presentation layer would have to account for the 1/1/1900 problem, which seems like something the business layer should have to do.
Is there any way I can store a value in a DateTime object, so when I use a ToString method, it returns as "", that would really fix it! Or any other suggestions I might try?
Thanks,
--Michael