string financial_year()
{
fin_str = "";
curr_year = zoho.currentdate.getYear();
curr_month = zoho.currentdate.getMonth();
if(curr_month > 3)
{
next_year = curr_year.toLong() + 1;
//last_2_dig = next_year.subString(2,4);
fin_str = curr_year + "-" + next_year;
//Use "last_2_dig" if u want to display last 2 digit of year
}
else
{
next_year = curr_year.toLong() - 1;
//last_2_dig = curr_year.subString(2,4);
fin_str = (curr_year - 1) + "-" + curr_year;
//Use "last_2_dig" if u want to display last 2 digit of year
}
return fin_str;
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter