cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member197751
Participant
0 Kudos

Hi,

     For displaying current date in design studio we will user "APPLICATION.getInfo().dateNow. Is there any possibility of displaying Yesterdays Date, in SAP Design studio.

Accepted Solutions (0)

Answers (2)

Answers (2)

MustafaBensan
Active Contributor
0 Kudos

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:

After calculation:

MustafaBensan
Active Contributor
0 Kudos

Hi Sateesh,

The Simple Date Object SDK Component will address your requirement.

Regards,

Mustafa.