kaz Posted November 14, 2019 Share Posted November 14, 2019 I would like to display the actual date in a page. Is there a code which I can use in the editor, not in template? Link to comment Share on other sites More sharing options...
wbmnfktr Posted November 14, 2019 Share Posted November 14, 2019 Where in a page? Somewhere in the editing screen? As a variable in a text/textarea field? Just as an information for content creators? Link to comment Share on other sites More sharing options...
kaz Posted November 14, 2019 Author Share Posted November 14, 2019 Correct, as text (variable) in the editor window. Link to comment Share on other sites More sharing options...
wbmnfktr Posted November 14, 2019 Share Posted November 14, 2019 You might want to look at Hanna Code then. Maybe a bit overhead but it will get the job done and can be used for lots of other stuff as well. In addition to that you want to use Hanna Code Dialog as well. There are some examples on the modules pages. Link to comment Share on other sites More sharing options...
OllieMackJames Posted November 14, 2019 Share Posted November 14, 2019 This works for me, placed it in hannah code [[date]] var days = ["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"]; var months = ["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"]; var d = new Date(); datum = days[d.getDay()] +', '+ d.getDate() +' '+ months[d.getMonth()] +' '+ d.getFullYear(); document.write('\x3Cp>\x3Cstrong>' + datum + '\x3C/strong>\x3C/p>'); just change days and months names to your language, works like a charm! 1 Link to comment Share on other sites More sharing options...
dragan Posted November 14, 2019 Share Posted November 14, 2019 You could also try this: https://ckeditor.com/docs/ckeditor4/latest/examples/timestamp.html 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now