Skip to content

Commit 4910a58

Browse files
authored
Merge pull request #64 from PRO100BYTE/update-date-command
Update date & time command
2 parents a763e19 + a853a24 commit 4910a58

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/commands/General/date.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import dateFormat from "dateformat";
2-
const date = new Date();
3-
const d = dateFormat(date, "ddd m-dd-yyyy");
42

53
export default class DateCommand {
64
execute(term, params, directory, setDirectory) {
5+
const date = new Date();
6+
const d = dateFormat(date, "ddd m-dd-yyyy");
77
term.writeln('');
88
term.writeln(`Current date is ${d}`);
99
term.writeln('');
1010
}
1111

1212
description() {
13-
return "Return current date";
13+
return "Print current date";
14+
}
15+
16+
help(term) {
17+
term.writeln("Usage: date")
18+
term.writeln("This command prints the current date in the format ddd m-dd-yyyy")
19+
term.writeln("Sample output: Thu 01-01-1970") // Current date is Thu 01-01-1970
1420
}
1521
}

src/commands/General/time.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export default class TimeCommand {
1616
help(term) {
1717
term.writeln("Usage: time");
1818
term.writeln("This command prints the current time in the format HH:mm:ss.SSS");
19+
term.writeln("Sample output: 12:34:30.00") // Current time is 12:34:30:00
1920
}
2021
}

0 commit comments

Comments
 (0)