From b29fce99dbfd3f795768cc24615d4009854d7e32 Mon Sep 17 00:00:00 2001 From: Tony Kovanen Date: Mon, 30 May 2016 12:00:10 +0300 Subject: [PATCH] Fix timestamp usage --- bin/now-alias | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/now-alias b/bin/now-alias index 84a395f..c01e1c3 100755 --- a/bin/now-alias +++ b/bin/now-alias @@ -120,11 +120,11 @@ async function run (token) { const sorted = await sort([...byTarget]); - const current = Date.now(); + const current = new Date(); const text = sorted.map(([target, _aliases]) => { const t = table(_aliases.map((_alias) => { const _url = chalk.underline(`https://${_alias.alias}`); - const time = chalk.gray(ms(current - _alias.created) + ' ago'); + const time = chalk.gray(ms(current - new Date(_alias.created)) + ' ago'); return [_alias.uid, _url, time]; }), { align: ['l', 'r', 'l'], hsep: ' '.repeat(6) }); return chalk.bold(target) + '\n\n' + indent(t, 2);