How to use Smart Date

How to use Smart Date

Old forum URL:

st3fanus posted on Thursday, December 15, 2011

Hi all,


I read this thread

currently, I have a field in the database with a Datetime type, and i want to load into a property on my Business Object use SmartDate as Property metadata and string as a expose property to view from UI.

my question here is : How do i can load technically  a datetime type into a my date property ( inside BO )

public static readonly PropertyInfo<SmartDate> DateProperty =
            RegisterProperty<SmartDate>(t => t.Date, null, new SmartDate { FormatString="dd-MM-yyyy" });
        public string Date
            get { return GetPropertyConvert<SmartDate, string>(DateProperty); }
            private set { LoadPropertyConvert<SmartDate, string>(DateProperty, value); }

Am I must do a manual convert from datetime into string as my property expose ??

any example or suggestion will help me a lot


thanks a lot


RockfordLhotka replied on Friday, December 16, 2011

I discuss this in the ebook series.

You can directly call ReadProperty and LoadProperty, and you can create a private property of type SmartDate that makes those calls to abstract their use somewhat. This private property would not declare another PropertyInfo metafield.

Copyright (c) Marimer LLC