Right now, I have a class defined as such:
public class Task
{
public Guid TaskId { get; set; }
public string TaskName { get; set; }
[DataType(DataType.Time)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = @"{0:hh\:mm}")]
public TimeSpan? TimeRequired { get; set; }
}
I would like to allow the user to also enter "2h" or "15m" for 2 hours or 15 minutes respectively. Is there a way I can allow these types of custom inputs? I was thinking of just creating a text box and then doing a custom check against that incoming value and cast it correctly to a TimeSpan. I wasn't sure if there was some type of "CustomConverter" much like the "CustomValidator" attribute.
Please let me know if anything is unclear.
Thanks in advance!