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

Date prompt displayed wrong

Started by RudiHendrix, 08 Feb 2017 07:38:04 AM

Previous topic - Next topic

RudiHendrix

We have migrated from Cognos 10.1.1 to 11.0.4. The content store has been copied and attached to the new version

So far a lot of stuff seems ok. However in one report it seems that there is a difference in rounding. I'll check that more in detail next.

Worse is the prompt parameter:
10.1.1: "1-jan-2017"
11.0.4: "1-jan-0117"

If I add a new prompt it does display "1-jan-2017"

I noticed this is caused by the following HTML item that is added:
<script type="text/javascript">
// Get prompt objects
var form = getFormWarpRequest();
var prompt_start = form.txtDateSDate;
var prompt_end = form.txtDateEDate;

// Calculate date
var t_now = new Date();
var t_start = '01-01' + t_now.getYear();
var t_end = '01-01' + (t_now.getYear()+1);

// Set prompt values
prompt_start.value = t_start;
prompt_end.value = t_end;

// Show the date in the correct format
pickerControlSDate.lostFocus();
pickerControlEDate.lostFocus();
</script>

Now, I have changed my language settings today, but somehow I have the idea this is done by Cogonos 11.0.4 rather than my language settings. Any idea?

Lynn

Quote from: Plantje on 08 Feb 2017 07:38:04 AM
We have migrated from Cognos 10.1.1 to 11.0.4. The content store has been copied and attached to the new version

So far a lot of stuff seems ok. However in one report it seems that there is a difference in rounding. I'll check that more in detail next.

Worse is the prompt parameter:
10.1.1: "1-jan-2017"
11.0.4: "1-jan-0117"

If I add a new prompt it does display "1-jan-2017"

I noticed this is caused by the following HTML item that is added:
<script type="text/javascript">
// Get prompt objects
var form = getFormWarpRequest();
var prompt_start = form.txtDateSDate;
var prompt_end = form.txtDateEDate;

// Calculate date
var t_now = new Date();
var t_start = '01-01' + t_now.getYear();
var t_end = '01-01' + (t_now.getYear()+1);

// Set prompt values
prompt_start.value = t_start;
prompt_end.value = t_end;

// Show the date in the correct format
pickerControlSDate.lostFocus();
pickerControlEDate.lostFocus();
</script>

Now, I have changed my language settings today, but somehow I have the idea this is done by Cogonos 11.0.4 rather than my language settings. Any idea?

Is this perhaps an example of JavaScript that does not work upon upgrade? IBM routinely says that this can happen.

RudiHendrix

In the mean time I've found it:

getYear()
Deprecated - Returns the year in the specified date according to local time. Use getFullYear instead.

Using getFullYear fixes the problem

StuartS

Hello

Do not know if this is relevant but we had an issue with the first released of 11.0.4 in terms of getting an active report to run with a regional setting of en-GB.  it would only run under en-US.

This was fixed in 11.0.4 FP1.

Stuart