I am trying to add the current date to a template similar to Meeting Notes. Running OnDemand so adding a user macro is not an option as described here: https://answers.atlassian.com/questions/25481
The Meeting Notes template uses and works great but only works on that specific blueprint.
Is there any plugin or way of automatically inserting the current date with the Confluence Cloud version?
I used the ‘CYO Create-Your-Own Custom Macro’ Macro to display the current date using this code:
<h1> <script type="text/javascript"> var d = new Date(); var curDate = d.getDate(); var curMonth = d.getMonth() + 1; //Months are zero based var curYear = d.getFullYear(); var dateCode = ((curMonth<=9 ? '0' + curMonth : curMonth) + "" + (curDate<=9 ? '0' + curDate : curDate) + "" + curYear) document.write(dateCode.small()); </script> </h1>
Hi
This doesn't work for me :(
After pasting this in left window it is treated literally as text and the javascript code is displayed in one line on the page.
Does anyone know why? And where are docs which explains what is the difference between left and right window?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Milo Grika's code does work.
after replacing all the HTMLSpecialChars with normal characters.
Click administration wheel -> general configuration -> user macro's.
Add his code as rendered.
From there you can add is as a macro '{' on your pages.
Edit: I have to add that 'User Macros' only work on Server platform, not Cloud platform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I seem to have difficulty in adding this as an available macro
I have created the following setup (see below)
But when I type {testpicker
the macro does not appear
Macro Name: testpick
Macro Title: testpicker
Macro Body Processing: Rendered
Template:
<h1>
<script type="text/javascript">
var d = new Date();
var curDate = d.getDate();
var curMonth = d.getMonth() + 1; //Months are zero based
var curYear = d.getFullYear();
var dateCode = ((curMonth<=9 ? '0' + curMonth : curMonth) + "" + (curDate<=9 ? '0' + curDate : curDate) + "" + curYear)
document.write(dateCode.small());
</script>
</h1>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.