I have a class like this
public class Model
{
public TimeSpan Time1 {get; set;}
public TimeSpan Time2 { get; set; }
public TimeSpan Time3 { get; set; }
public TimeSpan Time4 { get; set; }
}
Now imagine that I have to fill in the time at runtime, and then figure out the time left between time 1 and time 2, then when that will pass. Find the time left between Time2 and Time3, and so on. However, I need to take into account what time it is.
Example:
Now 1:00 PM
Time1 = 5:00 Time 2 = 12:00 Time 3 = 4:00 pm Time 4 = 6:00 pm
So, since the time is 1:00 PM, I need to find the difference between Time 2 and Time 3
Now is there a smarter way than thinking to define it? Should I add something in my class
source
share