From 596756140de06049a4228b0206d96c0c5b2a401c Mon Sep 17 00:00:00 2001 From: marinewater Date: Sun, 27 Mar 2016 01:46:28 +0100 Subject: [PATCH 1/2] Update fromnow-tests.ts --- fromnow/fromnow-tests.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fromnow/fromnow-tests.ts b/fromnow/fromnow-tests.ts index b95a236406..4ed78816aa 100644 --- a/fromnow/fromnow-tests.ts +++ b/fromnow/fromnow-tests.ts @@ -6,6 +6,10 @@ function dateOnly() { fromnow( '2015-12-31' ); } +function dateObjectOnly() { + fromnow( new Date() ); +} + function maxChunks() { fromnow( '2015-12-31', { maxChunks: 12 @@ -22,4 +26,4 @@ function useAnd() { fromnow( '2015-12-31', { useAnd: true }); -} \ No newline at end of file +} From c2da4112f2f4b075d05cdc057200ff2b6255b986 Mon Sep 17 00:00:00 2001 From: marinewater Date: Sun, 27 Mar 2016 01:48:20 +0100 Subject: [PATCH 2/2] Update fromnow.d.ts --- fromnow/fromnow.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fromnow/fromnow.d.ts b/fromnow/fromnow.d.ts index ea7ef657af..d2b90891ec 100644 --- a/fromnow/fromnow.d.ts +++ b/fromnow/fromnow.d.ts @@ -12,13 +12,13 @@ declare namespace FromNow { export interface FromNowStatic { /** * Get readable time differences from now vs past or future dates. - * @param {string} date + * @param {string|Date} date * @param {object} [opts] * @param {number} [opts.maxChucks=10] * @param {boolean} [opts.useAgo=false] * @param {boolean} [opts.useAnd=false] */ - (date: string, opts?: FromNowOpts): string + (date: string|Date, opts?: FromNowOpts): string } }