As I work on designing an interface for my personal project, I am in need of adding a field that represents the length of time taken to complete a task. What data type and format should I use in TypeScript to express this?
Below is the interface I have created:
export interface Task {
id: number,
name: string,
taskDate: Date,
taskDuration: {DURATION TYPE HERE}
}
While there are methods available online to calculate duration based on two dates using taskStart
and taskEnd
, I am seeking a more straightforward way to input the duration without needing to perform calculations.