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
Added savepdf Command. #208
Conversation
… into savepdf # Conflicts: # src/main/java/seedu/address/logic/parser/AddressBookParser.java
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.
Seems like a pretty cool feature. Just some adjustments
|
||
private static final String FILE_PATH_FOR_PDF = "./data/" + FILE_NAME + " %1$s.pdf"; | ||
|
||
private final Clock clock; |
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.
Use GlobalClock
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.
solved
* | ||
* @throws ParseException if date format is invalid. | ||
*/ | ||
public static LocalDate parseAnyDate(String date) throws ParseException { |
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.
This should replace parseDate
. Parser shouldn't be checking if the day is before today actually, it's a parser so any date that is valid should pass.
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, check today on wards at command side
} | ||
|
||
try { | ||
Optional<LocalDate> date = Optional.of(ParserUtil.parseAnyDate(args)); |
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.
Any reason with using Optional? Date should always be non null.
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.
savepdf has optional date input, so if there's no date input, then ill throw in a optional.empty() as parameter of the constructor
* @param date date of delivery. | ||
* @return filtered task list that contains only tasks on a specific date and are ONGOING or COMPLETE. | ||
*/ | ||
private List<Task> filterTasksBasedOnDate(List<Task> tasks, LocalDate date) { |
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.
This code seems very familiar. If it's anywhere else, consider reusing that code.
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.
i try and find
Closes #123
Format:
-savepdf
-savepdf [DATE]
Saves drivers' tasks into pdf format.