From df9c33041184dd9f0e57c9245d361cef6d8a85e1 Mon Sep 17 00:00:00 2001 From: nanov Date: Wed, 6 Nov 2019 16:52:31 +0200 Subject: [PATCH] feat: drop moment dependency --- lib/BankLetter.js | 6 +++--- package.json | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/BankLetter.js b/lib/BankLetter.js index 5c77a3b..8a7bae6 100644 --- a/lib/BankLetter.js +++ b/lib/BankLetter.js @@ -2,15 +2,15 @@ const fs = require('fs'); -const moment = require('moment'); const handlebars = require('handlebars'); const Crypto = require('./crypto/Crypto'); +const { date } = require('./utils.js'); // const BN = require('bn.js'); const registerHelpers = () => { - handlebars.registerHelper('today', () => moment().format('DD.MM.YYYY')); + handlebars.registerHelper('today', () => date.toISODate(Date.now(), false)); - handlebars.registerHelper('now', () => moment().format('HH:mm:ss')); + handlebars.registerHelper('now', () => date.toISOTime(Date.now(), false)); handlebars.registerHelper('keyExponentBits', k => Buffer.byteLength(k.e()) * 8); diff --git a/package.json b/package.json index 3c08956..1abbeaa 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "bn.js": "^5.0.0", "handlebars": "^4.4.3", "js2xmlparser": "^4.0.0", - "moment": "^2.24.0", "node-forge": "^0.9.1", "request": "^2.88.0", "uuid": "^3.3.3",