Skip to content

[W5][T09-3]Rachel Lim - #53

Open
rachellim10 wants to merge 2 commits into
nusCS2113-AY1819S2:masterfrom
rachellim10:master
Open

[W5][T09-3]Rachel Lim#53
rachellim10 wants to merge 2 commits into
nusCS2113-AY1819S2:masterfrom
rachellim10:master

Conversation

@rachellim10

Copy link
Copy Markdown

Added clock function that prints date and time

@arhjaye

arhjaye commented Feb 11, 2019

Copy link
Copy Markdown

Would be good to have a test file to ensure output is as expected for new function

@stephlewyh stephlewyh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Rachel,

Good job this time!

However, you could write unit tests to ensure that your program prints out the correct datetime format. Also you need to ensure that header comments are added to methods to inform the reader of its functionality.

Comment thread docs/UserGuide.adoc
Format: `clear`

== Prints out current date and time : `clock`
Format: `clock`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the description for your feature? It is missing.

+ ": Prints date and time in format: day, date-month-year at hr:min:sec AM/PM timezone.\n"
+ "Example: " + COMMAND_WORD;

@Override

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing header comment. All non-trivial methods should have java doc format header comments.

public CommandResult execute() {
Date now = new Date();
SimpleDateFormat dateFormatter = new SimpleDateFormat("E, dd-MM-yyyy 'at' hh:mm:ss a z");
//System.out.println("Date & Time now: " + dateFormatter.format(now));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not necessary for your program to run, nor does it improve readability of your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants