Closed GoogleCodeExporter closed 9 years ago
This is actually not supported in the way that you are trying to do it. Due to
the way it's designed, scalar types (int's, bool's, string's, Date's, etc)
don't allow converters to be registered on the type itself, only on the
property. Step #2 in your scenario is supposed to throw an exception, but
there's a bug there and it's not. If you want to change the formatting or
style on the dates you can do it like this:
DateTimeExpressionHandler handler = new DateTimeExpressionHandler("F");
Serializer s = new Serializer(typeof(SomeClass));
s.Config.ExpressionHandlers.InsertBefore(typeof(DateTimeExpressionHandler), handler);
You can also set DateTimeStyles and CultureInfo property on the
DateTimeExpressionHandler as well if necessary.
Original comment by elliott....@gmail.com
on 21 Dec 2011 at 10:16
Original issue reported on code.google.com by
mwe.icom...@gmail.com
on 12 Jul 2011 at 1:46