From 1f4622e924f9c3d8d31f99028d9f89cba8dc465f Mon Sep 17 00:00:00 2001 From: Alexandr Boltris Date: Fri, 22 Sep 2017 21:53:14 +0200 Subject: [PATCH] Connection: add leading zero to single digit date --- lib/Connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 619862ff..8a6a290c 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -338,7 +338,7 @@ Connection.prototype.append = function(data, options, cb) { if (!isDate(options.date)) throw new Error('`date` is not a Date object'); cmd += ' "'; - cmd += options.date.getDate(); + cmd += ('0' + options.date.getDate()).slice(-2); cmd += '-'; cmd += MONTHS[options.date.getMonth()]; cmd += '-';