New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit task command #100
Edit task command #100
Conversation
…ation (Eg. 1030 - 1200).
…sk. Deleted Customer List and Driver List because using UniquePersonList<T> now.
String startTimeStr = durationArr[0]; | ||
String endTimeStr = durationArr[2]; | ||
|
||
return parse(startTimeStr, endTimeStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a public facing static method, you may want to apply the regex check to duration
to ensure that the input is in the correct form? Otherwise, duration[i]
may throw IndexOutOfBoundError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay noted, because usually we check if is valid then we parse, so i didn't include it.
But for safety, i will include isValidDuration under the parse and create a IncorrectFormat exception for it to throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding assert instead
* Example: 1200 - 1330. | ||
*/ | ||
public static String getStringFromDuration(EventTime duration) { | ||
DateTimeFormatter jsonFormatter = DateTimeFormatter.ofPattern("Hmm"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract to a static field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay noted
Added Edit task command
-refer to commits for updates
*Storage for tasks not done
-will do by Sunday.