If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Javascript to set date

Started by EArumugam, 07 Oct 2009 02:03:34 AM

Previous topic - Next topic

EArumugam

Hi All,

in my report having From and To date prompt.

I need to set it as Jul 1 and Jun 30 of the current fiscal year(2009)

eg:
from date shud be set to Jul 1,2008 and to date set to Jun 30, 2009


Any javasript to set this date.

thanks




CognosPaul

Assuming the date prompts names are FROM and TO:

FROM:
<script>
function FiscalYearStart()
{
var strStartFiscal  = [new Date().getUTCFullYear()-1,7,30].join("-");
return strStartFiscal;
}
pickerControlPrompt[b]FROM[/b].setValue(FiscalYearStart() );
</script>


TO:
<script>
function FiscalYearEnd()
{
var strEndFiscal  = [new Date().getUTCFullYear(),6,1].join("-");
return strEndFiscal;
}
pickerControlPrompt[b]TO[/b].setValue(FiscalYearEnd() );
</script>