mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add helper to convert isostrings to localeString
This commit is contained in:
@@ -28,6 +28,7 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
generateRepliedTo,
|
||||
generateWrote,
|
||||
register,
|
||||
isoTimeToLocaleString,
|
||||
__escape: identity,
|
||||
};
|
||||
|
||||
@@ -337,6 +338,10 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
return `[[topic:wrote-${langSuffix}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`;
|
||||
}
|
||||
|
||||
function isoTimeToLocaleString(isoTime) {
|
||||
return new Date(isoTime).toLocaleString().replace(/,/g, ',');
|
||||
}
|
||||
|
||||
function register() {
|
||||
Object.keys(helpers).forEach(function (helperName) {
|
||||
Benchpress.registerHelper(helperName, helpers[helperName]);
|
||||
|
||||
Reference in New Issue
Block a user