fredag den 14. marts 2014

Fixing Webforms for Marketeers saving dates in different formats

We had an issue a while ago, with a customer where their webforms started saving dates in different formats in the database, which caused the exported data to be mangled.

Sitecore Support found the solution - it seems like the DatePicker control has a bug, where the DatePicker is missing the correct adapter.

The solution is simple - create your own DatePicker class, that extends the builtin DatePicker class, like this:

[Adapter(typeof(DateAdapter))]
public class DatePicker : Sitecore.Form.Web.UI.Controls.DatePicker
{

}

Compile the code, and then go to this item in the master db: "/sitecore/system/Modules/Web Forms for Marketers/Settings/Field Types/Simple Types/Date Picker"

Here you change the Assembly and Class fields to match this class, save the item and publish it.

Done! - really, that is all there is to it - do this, and now your dates show up correct.

Ingen kommentarer:

Send en kommentar