Skip to content

Commit

Permalink
Switch from moment to date-fns.
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML authored and gustavohenke committed Jan 27, 2017
1 parent 26abfed commit 5a0d525
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Options:
See https://www.npmjs.com/package/chalk for more information.
Default: "gray.dim". Example: "black.bgWhite,cyan,gray.dim"
-t, --timestamp-format <format> specify the timestamp in moment format. Default: YYYY-MM-DD HH:mm:ss.SSS
-t, --timestamp-format <format> specify the timestamp in moment/date-fns format. Default: YYYY-MM-DD HH:mm:ss.SSS
-r, --raw output only raw output of processes, disables prettifying and concurrently coloring
-s, --success <first|last|all> Return exit code of zero or one based on the success or failure of the "first" child to terminate, the "last" child, or succeed only if "all" child processes succeed. Default: all
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"dependencies": {
"chalk": "0.5.1",
"commander": "2.6.0",
"date-fns": "^1.23.0",
"lodash": "^4.5.1",
"moment": "^2.17.1",
"rx": "2.3.24",
"spawn-default-shell": "^2.0.0",
"tree-kill": "^1.1.0"
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var Rx = require('rx');
var path = require('path');
var moment = require('moment');
var formatDate = require('date-fns/format');
var program = require('commander');
var _ = require('lodash');
var treeKill = require('tree-kill');
Expand Down Expand Up @@ -34,7 +34,7 @@ var config = {
// Comma-separated list of chalk color paths to use on prefixes.
prefixColors: 'gray.dim',

// moment format
// moment/date-fns format
timestampFormat: 'YYYY-MM-DD HH:mm:ss.SSS',

// How many characters to display from start of command in prefix if
Expand Down Expand Up @@ -100,7 +100,7 @@ function parseArgs() {
)
.option(
'-t, --timestamp-format <format>',
'specify the timestamp in moment format. Default: ' +
'specify the timestamp in moment/date-fns format. Default: ' +
config.timestampFormat + '\n'
)
.option(
Expand Down Expand Up @@ -353,7 +353,7 @@ function getPrefixes(childrenInfo, child) {
prefixes.pid = child.pid;
prefixes.index = childrenInfo[child.pid].index;
prefixes.name = childrenInfo[child.pid].name;
prefixes.time = moment().format(config.timestampFormat);
prefixes.time = formatDate(Date.now(), config.timestampFormat);

var command = childrenInfo[child.pid].command;
prefixes.command = shortenText(command, config.prefixLength);
Expand Down

0 comments on commit 5a0d525

Please sign in to comment.