Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: How to display "current date -1" means yesterdays date without any query

$
0
0

As a follow-up to my suggestion, here's an implementation example.

 

Script to calculate yesterday's date:

 

var today = APPLICATION.getInfo().dateNowInternalFormat;
SIMPLEDATE_1.initializeWithInternalDate(today);
var todayFormatted = SIMPLEDATE_1.format("DD.MM.YYYY");
SIMPLEDATE_1.rollDays(-1);
var yesterdayFormatted = SIMPLEDATE_1.format("DD.MM.YYYY");
TEXT_1.setText("Today is " + todayFormatted + ".  Yesterday was " + yesterdayFormatted + ".");

 

Before calculation:

AfterCalculation.png

 

After calculation:

BeforeCalculation.png


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>