Jump to content
kaz

actual date

Recommended Posts

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?

Share this post


Link to post
Share on other sites

Where in a page?

Somewhere in the editing screen?
As a variable in a text/textarea field?
Just as an information for content creators?

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

 

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...