WebSite X5Help Center

 
Robert A.
Robert A.
User

The [DATE] tag has stopped working on 13/12/2019  en

Autor: Robert A.
Besucht 2122, Followers 2, Geteilt 0  

Hello,

On my page: http://www.ex-l-ence.com/ - I use the [DATE] tag in a text object "Our bestselling title for the 30 days to [DATE] is ......... "  - Why has it stopped working on the 13th - Superstitious? It was Friday the 13th :)

Thanks,

Robert.

Gepostet am
12 ANTWORTEN - 1 KORREKT
Robert A.
Robert A.
User
Autor

Hmmmm - I just uploaded the site again - and now it's updated???

Mehr lesen
Gepostet am von Robert A.
Aleksej H.
Aleksej H.
Moderator

Hello.Please specify your problem has already been resolved?

Mehr lesen
Gepostet am von Aleksej H.
Robert A.
Robert A.
User
Autor

Hi Aleksej,

Sadly no it's not fixed - now it's stuck on the 20th ???

Mehr lesen
Gepostet am von Robert A.
Aleksej H.
Aleksej H.
Moderator

Show how exactly the object with this tag looks.

It seems that it is intended only to indicate the current date at the time of adding.

Mehr lesen
Gepostet am von Aleksej H.
Robert A.
Robert A.
User
Autor

Hi Aleksej,

That's very odd as it WAS working for quite some time - I wondered if an upgrade to the software had changed it's behaviour?

Mehr lesen
Gepostet am von Robert A.
Robert A.
Robert A.
User
Autor

The way I am using it is: On my page: http://www.ex-l-ence.com/ - I use the [DATE] tag in a text object "Our bestselling title for the 30 days to [DATE] is xxxxxx "  - the xxxxxx is where I have to manually alter text if the bestselling book changes (which has not happened in over 3 months).

Mehr lesen
Gepostet am von Robert A.
Aleksej H.
Aleksej H.
Moderator

I meant send a screenshot of the program window, where I can see the tag itself.

"I wondered if an upgrade to the software had changed it's behaviour?" - may be.Maybe something has changed on the hosting.

Mehr lesen
Gepostet am von Aleksej H.
Robert A.
Robert A.
User
Autor

Hello Aleksej,

Sorry for the delay in replying - away for Christmas & New Year - by the way - Happy 2020 to you.

Screen captures attached...

Mehr lesen
Gepostet am von Robert A.
Aleksej H.
Aleksej H.
Moderator

"Happy 2020 to you" - And you too! wink

Regarding your question.Everything seems to work right.The current date at the time the site is uploaded is inserted on the page.This tag will not help you to display the current date (without the daily unloading site).

Mehr lesen
Gepostet am von Aleksej H.
John S.
John S.
User

Hello Robert

To show the actual date you could use this :

---------------------------------------------------------

<p style="margin: 0; display: inline;">Our bestselling title for the 30 days to</p>
<p style="margin: 0; display: inline;" id="date"></p>


<script>
n = new Date();
y = n.getFullYear();
m = n.getMonth() + 1;
d = n.getDate();
document.getElementById("date").innerHTML = m + "/" + d + "/" + y;
</script>

------------------------------------------------------------------

You can style the date format as you wish.

The example will ( for today/postdate) give this :

Our bestselling title for the 30 days to 1/3/2020

The code between the ---- should be put in a HTML-object.

Hope it was something like this you are looking for.

Mehr lesen
Gepostet am von John S.
John S.
John S.
User

Example where the title is styled with a bigger font. You can also change colors and so - but be aware that it could look messy if too much styling is used.

<p style="margin: 0; display: inline;">Our bestselling title for the 30 days to</p>
<p style="margin: 0; display: inline;" id="date"></p>
<p style="margin: 0; font-size:300%; display: inline;">The BESTSELLER</p>


<script>
n = new Date();
y = n.getFullYear();
m = n.getMonth() + 1;
d = n.getDate();
document.getElementById("date").innerHTML = m + "/" + d + "/" + y;
</script>

Mehr lesen
Gepostet am von John S.
Robert A.
Robert A.
User
Autor

Hello John,

Many thanks - your code gave me the answer, although I decided to simplify what I was showing on my site to last month's bestselling title and used:

<p style="margin: 0; display: inline;"><h5>Our bestselling title for last month</p>
<p style="margin: 0; display: inline;" id="date"></p><br>
<p style="margin: 0; display: inline;"><a href="http://www.ex-l-ence.com/miracles-on-the-camino.html">Miracles On The Camino</a></h5></p>

<script>

n = new Date();
var months = ["December","January", "February", "March", "April", "May", "June", "July", "August", "September", "October", ];

m = n.getMonth() + 1;

document.getElementById("date").innerHTML = months[n.getMonth()];
</script>

I left in some redundant code in case I want to play with the output some more :)

Have a great 2020 :) 

Mehr lesen
Gepostet am von Robert A.