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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...