File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
import dateFormat from "dateformat" ;
2
- const date = new Date ( ) ;
3
- const d = dateFormat ( date , "ddd m-dd-yyyy" ) ;
4
2
5
3
export default class DateCommand {
6
4
execute ( term , params , directory , setDirectory ) {
5
+ const date = new Date ( ) ;
6
+ const d = dateFormat ( date , "ddd m-dd-yyyy" ) ;
7
7
term . writeln ( '' ) ;
8
8
term . writeln ( `Current date is ${ d } ` ) ;
9
9
term . writeln ( '' ) ;
10
10
}
11
11
12
12
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
14
20
}
15
21
}
Original file line number Diff line number Diff line change @@ -16,5 +16,6 @@ export default class TimeCommand {
16
16
help ( term ) {
17
17
term . writeln ( "Usage: time" ) ;
18
18
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
19
20
}
20
21
}
You can’t perform that action at this time.
0 commit comments