From 4b1d93b9f802543356b67380b65b2ec5692f2e16 Mon Sep 17 00:00:00 2001 From: Johan Preynat Date: Fri, 26 Jan 2018 11:34:09 +0100 Subject: [PATCH] Fix padding of timezone for Authors --- lib/models/author.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/models/author.js b/lib/models/author.js index f70e3df..d474641 100644 --- a/lib/models/author.js +++ b/lib/models/author.js @@ -59,9 +59,9 @@ Author.createFromString = function createFromString(str) { */ Author.createFromPerson = function createFromPerson(person, date) { var offset = new Date().getTimezoneOffset(); - offset = ((offset<0? '+':'-') + - pad('' + parseInt(Math.abs(offset/60)), 2) + - pad('' + Math.abs(offset%60), 2)); + offset = ((offset<=0? '+':'-') + + pad(2, '' + parseInt(Math.abs(offset/60)), '0') + + pad(2, '' + Math.abs(offset%60), '0')); return new Author({ name: person.getName(),