added macro for displaying current date/time
This commit is contained in:
parent
f083851ff6
commit
4eb9174a31
1 changed files with 13 additions and 0 deletions
13
code/Global/macros.js
Normal file
13
code/Global/macros.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* macro renders the current timestamp
|
||||
*/
|
||||
|
||||
function now_macro(param) {
|
||||
renderPrefix(param);
|
||||
var now = new Date();
|
||||
if (param.format)
|
||||
res.write(now.format(param.format));
|
||||
else
|
||||
res.write(now.format("yyyy.MM.dd HH:mm"));
|
||||
renderSuffix(param);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue