Topic
  • 4 replies
  • Latest Post - ‏2013-03-22T23:33:24Z by KaranBal
babinag
babinag
91 Posts

Pinned topic Timezone display issue.

‏2013-03-19T07:38:56Z |
Hello.

I have a "date"-type field in spec of some catalog item.
For example, this field have simple value rule as

var todayDate = today(); res = todayDate;

Every time I press "save", this field refreshed and I have incorrect -1hour displayed value. 10:23 AM instead of 11:23 AM, for example.
But when I get value of such attribute via script, it have correct 11:23 AM value.
This issue happens in MDM9.1-no-fixpack, but in MDM9.1fp9+ and MDM10.1 date displays correctly.
How can I fix this in MDM9.1-no-fixpack? Seems that widget date convertation logic is incorrect somewhere?

I have updated java timezones, new Date() or today() returns correct datetime values, OS time also correct.
Updated on 2013-03-22T23:33:24Z at 2013-03-22T23:33:24Z by KaranBal
  • babinag
    babinag
    91 Posts

    Re: Timezone display issue.

    ‏2013-03-19T12:23:01Z  
    One note.
    After this modification
    
    var todayDate = today(); res = checkString(todayDate, 
    "");
    

    or if i use
    
    @Override 
    
    public Object rule(ItemRunValueRuleFunctionArguments inArgs) 
    { 
    
    return 
    
    new Date().toString(); 
    }
    

    shows correct value as with toString().
    My thought is that widget use its own timezone offsets to render datetime value and do not use user.timezone system property. And seems that it has been fixed in latest patches.
  • KaranBal
    KaranBal
    108 Posts

    Re: Timezone display issue.

    ‏2013-03-19T16:48:07Z  
    • babinag
    • ‏2013-03-19T12:23:01Z
    One note.
    After this modification
    <pre class="jive-pre"> var todayDate = today(); res = checkString(todayDate, ""); </pre>
    or if i use
    <pre class="jive-pre"> @Override public Object rule(ItemRunValueRuleFunctionArguments inArgs) { return new Date().toString(); } </pre>
    shows correct value as with toString().
    My thought is that widget use its own timezone offsets to render datetime value and do not use user.timezone system property. And seems that it has been fixed in latest patches.
    Try switching to the classic UI and test whether the behavior is reproducible. If it is not, the root cause is probably APAR#JR39254 which was fixed in 9.0.0 IF7 and subsequent 9.1.0 fix pack.
    If it is indeed the same issue, then the work around was to set "Date only = false" in the spec attribute definition(its a check box).
  • babinag
    babinag
    91 Posts

    Re: Timezone display issue.

    ‏2013-03-20T11:40:34Z  
    • KaranBal
    • ‏2013-03-19T16:48:07Z
    Try switching to the classic UI and test whether the behavior is reproducible. If it is not, the root cause is probably APAR#JR39254 which was fixed in 9.0.0 IF7 and subsequent 9.1.0 fix pack.
    If it is indeed the same issue, then the work around was to set "Date only = false" in the spec attribute definition(its a check box).
    Hello, KaranBal.

    Thanks for you answer.

    "Date only = false" does not help.
    I did not found how to switch to Classic UI, but i think this ui is not suitable.

    The subject of APAR you mentioned is similar to my problem. I need an upgrade to latest fixpack or version.
  • KaranBal
    KaranBal
    108 Posts

    Re: Timezone display issue.

    ‏2013-03-22T23:33:24Z  
    • babinag
    • ‏2013-03-20T11:40:34Z
    Hello, KaranBal.

    Thanks for you answer.

    "Date only = false" does not help.
    I did not found how to switch to Classic UI, but i think this ui is not suitable.

    The subject of APAR you mentioned is similar to my problem. I need an upgrade to latest fixpack or version.
    Yeah, I am not sure why you are seeing this. Date type attribute saved only the date but I tried the value rule on a string attribute and it displayed correctly. But then again I was testing with a v-10 instance and you already told us that it works.

    Unfortunately I do not have a v-9, no fix pack instance and therefore can't try to reproduce it. But I don't think the code would do any conversion to change time by 1 hour(there's no reason for it) but it is possible that it is using a different date, say of WAS or more probably the database server etc. But I can't test it, sorry. You should open a PMR if this is important for your use case.

    On a general note, to switch to the classic UI go to "Home" > "My Setting" and you will see a drop down named "For editing and entering data, use". In this drop down if you select "Single Edit", then you will be sent to the classic UI(the user interface in version 6). The other 3 options are for the new UI with "Single and multi-edit with rich search simplified" being the most common.