I have this working example to automatically update the copyright year, but how do I create this using the Properties panel.
© Copyright 2019{{varDate.datetime.formatDate("yyyy") == 2019 ? "" : " - " + (varDate.datetime.formatDate("yyyy"))}}
I have this working example to automatically update the copyright year, but how do I create this using the Properties panel.
© Copyright 2019{{varDate.datetime.formatDate("yyyy") == 2019 ? "" : " - " + (varDate.datetime.formatDate("yyyy"))}}
this is nice and should be in some „Snippets“ shared online within the Community with a star rating
Thank you Freddy, it’s very simple and have been using it for a while now, replacing tte PHP (and sometimes jQuery) code. But it can only be Wappler certified when it is created using Wappler.
Hi Ben,
Why not using PHP for that?
Hi Teodor,
I have alternated between using PHP and JavaScript for this. The great part with using JS is that I no longer have to use the PHP extension for my documents.
Above all, I want to Wapplerise all of my projects.
Great ‘Wapplerized’ tutorial Ben!
Here’s my quick one…
<a class="text-muted small" href="//blaxstudios.com"> © 2009 — <?php echo date("Y"); ?>
You can also use JavaScript when you don’t have PHP on your server.
© Copyright <script>document.write((new Date()).getFullYear())</script>
If you don’t like using document.write or want more control
© Copyright 2019<span id="copy"></span>
<script>
var currentYear = (new Date()).getFullYear();
if (currentYear > 2019) {
document.getElementById('copy').textContent = ' - ' + currentYear;
}
</script>
And the Wappler or App Connect way
© Copyright {{ "now".formatDate("yyyy") }}
I personally use the Wappler way. Mostly because it takes literally seconds to add in Wappler.