Topic
5 replies Latest Post - ‏2014-04-23T22:49:52Z by Lowis
JennyLiu
JennyLiu
14 Posts
ACCEPTED ANSWER

Pinned topic How to change the Prompt Date Format

‏2011-06-03T16:35:44Z |
Hi,

We're trying to change the Calendar Date Prompt Format to "mm/dd/yyyy". One of the options from Internet is to change the Locale set on .JS file on the Server but we are not allowed to do this because there are more applications running of the same server and we can not impact any other applications.

There are some options we found, including adding Java Scripts. Howerver, most of the examples are associated on how to set default values to Prompt date and there is no property in genSelectDateHTML to let you set the date format.

Very appreciated for sharing your experience or any idea.

Thanks,

Jenny
Updated on 2013-02-05T03:45:30Z at 2013-02-05T03:45:30Z by SystemAdmin
  • DPotterSQL
    DPotterSQL
    60 Posts
    ACCEPTED ANSWER

    Re: How to change the Prompt Date Format

    ‏2011-06-08T21:24:43Z  in response to JennyLiu
    JennyLiu,

    Can you please elaborate further?
    If you're saying that you need the date from the Calendar Date Prompt to match a data type that is not a date then you would just have to use the cast/convert function in order to compare. You can also break apart the parts of the date and do your comparison that way.
    If you're just looking to display the prompt date as mm/dd/yyyy, you can set up three prompt text boxes with titles above them and then concatenate them together in the filter and cast/convert if necessary for comparison.
    If you give me a little more information about what you're trying to do I may be able to help further.

    DPotterSQL
    • JennyLiu
      JennyLiu
      14 Posts
      ACCEPTED ANSWER

      Re: How to change the Prompt Date Format

      ‏2011-06-09T14:20:02Z  in response to DPotterSQL
      Hi DpotterSQL,

      First of all, it is a Calendar Date Prompt. By default, it is displayed as June 8,2011. Now we just want to change its display as 06/08/2011, but still choose the date from a Calendar.

      By using the Java Script we can make it showing as this format with the default value. And then we select the expected Date from the Calendar, and then we are not able to refresh it with the format of mm/dd/yyyy. I think what we're missing here is "what event in Calenda Date Prompt" should be used to refresh the value in the prompt.

      Any idea will be very appreciated

      Thanks,

      Jenny
  • Lowis
    Lowis
    4 Posts
    ACCEPTED ANSWER

    Re: How to change the Prompt Date Format

    ‏2014-04-23T22:49:44Z  in response to JennyLiu

    You should all look a this solution if you want to adjust the date format of athe textbox prompt with calendar

    It work for Cognos 8.3 .... and nearly the same in Cognos 10.2.x

     

    http://cognosibm.blogspot.ca/2009/02/prompt-date-formats.html