I am trying to apply a custom datetime format to an array of datetime values. I know you can use IsoDateTimeConverter to accomplish this for single values e.g.
class CustomDateTimeConverter : IsoDateTimeConverter
{
public CustomDateTimeConverter()
{
base.DateTimeFormat = "yyyy-MM-dd";
}
}
class ReturnObjectA
{
[JsonConverter(typeof(CustomDateTimeConverter))]
public DateTime ReturnDate { get; set;}
}
But how do apply the same thing to an array of datetimes? e.g. The following does not work.
class ReturnObjectA
{
[JsonConverter(typeof(CustomDateTimeConverter))]
public DateTime[] ReturnDate { get; set;}
}