Hi,
I wad trying to display the date of previous day and I am successful also. But the problem is that I want to show like this:-
1st
2nd
3rd
4th
5th
:
:
:
31st
After 1, it should show 'st'
After 2, it should show 'nd'
And so on......
In every date it is only showing only 'th'.
Please Help!!
http://automagic4android.com/flow.php?i ... c5dc2030d6
Date
Moderator: Martin
Re: Date
Hi,
There needs to be a slight modification in your script:
I just changed the formatting of daym to use one digit for the day and use the single number also in the if-checks.
Regards,
Martin
There needs to be a slight modification in your script:
Mainly the formatting of daym seems to be wrong in the shared flow.today = getDate();
today = addDays(today, -1);
daym = "{today,dateformat,d}";
if(daym == '1'){
finalDate = "{today,dateformat, '1st' MMMM yyyy}";
}else if(daym == '2'){
finalDate = "{today,dateformat, '2nd' MMMM yyyy}";
}else if(daym == '3'){
finalDate = "{today,dateformat, '3rd' MMMM yyyy}";
}else{
finalDate = "{today,dateformat, dd'th' MMMM yyyy}";
}
I just changed the formatting of daym to use one digit for the day and use the single number also in the if-checks.
Regards,
Martin