in my application i have a song class which has a property length and this looks like:
[DisplayFormat(DataFormatString = "{0:mm\\:ss}", ApplyFormatInEditMode = true)]
[RegularExpression(@"[0-6][0-9]\:[0-5][0-9]", ErrorMessage = "Invalid Time.")]
public TimeSpan? Length { get; set; }
so i want it to display mm:ss and it works like a charm but as i want to validate my input that doesn't work as good. i also want the user to input the length as mm:ss, so that is forced by the regex. but my application interprets the minutes as hours and the seconds as minutes.
so when i enter 05:25, my length will be set to 05:25:00. how can i change this? i'm just a beginner so i appologize if this is a stupid question. thanks in advance