Skip to content

Commit

Permalink
present correct options
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jul 6, 2016
1 parent 4df979d commit 7c2a06a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/prepareDateRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ module.exports = function(done) {

// we have been counting reversed chronologically
// (backwards, from now into the past), flip definitions
ranges = ranges.reverse();
_.map(ranges, r => {
return {
from: r.to,
to: r.from
}
})
});

if(_.size(ranges) === 1) {
var r = _.first(ranges);
Expand All @@ -128,11 +129,11 @@ module.exports = function(done) {
'Gekko detected multiple dateranges in the locally stored history.',
'Please pick the daterange you are interested in testing:'
);

_.each(ranges, (range, i) => {
var r = _.first(ranges);
log.info('\t\t', `OPTION ${i + 1}:`);
log.info('\t', 'from:', moment.unix(r.from).utc().format('YYYY-MM-DD HH:mm:ss'));
log.info('\t', 'to:', moment.unix(r.to).utc().format('YYYY-MM-DD HH:mm:ss'));
log.info('\t', 'from:', moment.unix(range.from).utc().format('YYYY-MM-DD HH:mm:ss'));
log.info('\t', 'to:', moment.unix(range.to).utc().format('YYYY-MM-DD HH:mm:ss'));
});

prompt.get({name: 'option'}, (err, result) => {
Expand Down

0 comments on commit 7c2a06a

Please sign in to comment.