Fix code issues

[MAILPOET-1145]
This commit is contained in:
Pavel Dohnal
2018-02-20 09:39:14 +00:00
parent 989baf2aa4
commit adb579a26c
4 changed files with 18 additions and 10 deletions

View File

@@ -24,7 +24,7 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) {
// set date format
f = block.hash.format || 'MMM Do, YYYY';
// check if we passed a timestamp
if (/^\d+$/.test(timestamp)) {
if (/^\s*\d+\s*$/.test(timestamp)) {
return window.moment.unix(timestamp).format(f);
}
return window.moment.utc(timestamp).format(f);