This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 8, 2014, 2:20 PM
8 Posts

Date Conflict Rich Client due to regional Settings (Region and Languages)

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 2

Dear Experts,

 

I have created date  & time objects by getting component value. Actually users are using different region settings due to software requirements they are using. My date and time objects works well with English United States but create date conflict with English United Kingdom ( its swap month with day).

Any idea how this can be managed at application level? because my users are using different regional settings?

Please help me to over come this problem.

 

Thanks,

Qaiser

 

Sep 12, 2014, 4:24 AM
8 Posts
No Solution??

Dear Experts,

I hope you guys are doing good. I just want to get status, that either you guys don't understand my problem or there is no solution of this issue in SSJS and only I have to recommend changes in Operating System Regional settings back to English-US??

Kindly reply me if you think there is solution of this issue or further information about the issues is required.

Your prompt help in this regard will be highly appreciated.

 

Thanks,

Qaiser

Sep 22, 2014, 11:26 AM
8 Posts
Solution

Finally I am able to solve this due to help of Mr. Knut Herrmann through Stack Overflow. Please find below solution of problem.

If you want to save component value in notes date and time field do this. 

var date:java.util.Date = getComponent("dateFrom").getValue();
document1.setValue("DateItemInDoc", session.createDateTime(date)) // replace item value can also be used. This will work on all types of regional settings. 

if you want use @Day, @Month, @Year and @Weekday get day, month, year and weekday. Use following Code

var mDt:NotesDateTime = session.createDateTime(getComponent("dateFrom").getValue());

var mDay:int = @Day(mDt.toJavaDate());

var mMonth:int = @Month(mDt.toJavaDate());

var mYear:int = @Year(mDt.toJavaDate());

var weekDay:int = @Weekday(mDt.toJavaDate());   /// mDt.getDateOnly will not work for OS UK regional settings.

 

Always use @Now() get server date and time and same can be used to store current date and time in notes document. 

document1.replaceItemValue("LastActionTakenOn", session.createDateTime(@Now()));

 

 

Thanks,

Qaiser


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal