From 9fc95b02e18310ed7df8b41da5c6013988f0d0e7 Mon Sep 17 00:00:00 2001 From: whatasoda Date: Wed, 13 Jun 2018 00:27:31 +0900 Subject: [PATCH] Modified test --- .../moment-shortformat-tests.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/types/moment-shortformat/moment-shortformat-tests.ts b/types/moment-shortformat/moment-shortformat-tests.ts index a0050348f7..84f754a750 100644 --- a/types/moment-shortformat/moment-shortformat-tests.ts +++ b/types/moment-shortformat/moment-shortformat-tests.ts @@ -1,20 +1,20 @@ import moment = require('moment'); -import momentShortformat = require('moment-shortformat'); - -moment === momentShortformat; // true +import 'moment-shortformat'; +let formatted: string; /*~ Formats time relative to current time. */ -moment(moment().valueOf() + (36e5 * 5)).short(); // in 5h -moment(moment().valueOf() - (36e5 * 5)).short(); // 5h ago -moment(moment().valueOf() + (36e5 * 5)).short(true); // 5h -moment(moment().valueOf() - (36e5 * 5)).short(true); // 5h +formatted = moment(moment().valueOf() + (36e5 * 5)).short(); // 'in 5h' +formatted = moment(moment().valueOf() - (36e5 * 5)).short(); // '5h ago' +formatted = moment(moment().valueOf() + (36e5 * 5)).short(true); // '5h' +formatted = moment(moment().valueOf() - (36e5 * 5)).short(true); // '5h' /*~ Times greater than 1 week are converted to dates like Mar 7, *~ or if the year of the date does not match the current year *~ it is convert to Mar 7, 2031 */ -moment(moment().valueOf() + 6048e5).short(); // Mar 7 +formatted = moment(moment().valueOf() + 6048e5).short(); // 'Mar 7' /*~ Using a different "now" */ -moment(moment().valueOf() + (36e5 * 5)) - .short(false, moment(moment().valueOf() + (36e5 * 3))); // in 2h +formatted = moment(moment().valueOf() + (36e5 * 5)).short( + false, moment(moment().valueOf() + (36e5 * 3)) +); // 'in 2h'