1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-26 18:58:21 +02:00

Desktop: Fixes #1803: Use correct date format for templates (#1810)

This commit is contained in:
Caleb John 2019-08-29 10:35:43 -06:00 committed by Laurent Cozic
parent 9a4f4cbb65
commit ac4986b620

View File

@ -4,8 +4,17 @@ const Mustache = require('mustache');
const TemplateUtils = {};
// Mustache escapes strings (including /) with the html code by default
// This isn't useful for markdown so it's disabled
Mustache.escape = text => {
return text;
};
TemplateUtils.render = function(input) {
// new template variables can be added here
// If there are too many, this should be moved to a new file
// view needs to be set in this function so that the formats reflect settings
const view = {
date: time.formatMsToLocal(new Date().getTime(), time.dateFormat()),
time: time.formatMsToLocal(new Date().getTime(), time.timeFormat()),
@ -17,13 +26,6 @@ const view = {
},
};
// Mustache escapes strings (including /) with the html code by default
// This isn't useful for markdown so it's disabled
Mustache.escape = text => {
return text;
};
TemplateUtils.render = function(input) {
return Mustache.render(input, view);
};