org-scn-design-studio-community / sdkpackage

SDK Package of SCN Design Studio Community
Apache License 2.0
32 stars 29 forks source link

International Date with REALDATE #172

Open HenryTaylor opened 7 years ago

HenryTaylor commented 7 years ago

I hope this is the right place to post this.

I'm trying to internationalize a dashboard we've built in DS 1.6 SP4 Patch 2. We're using the 3.0 SCN SDK components.

I am returning dates from a Datastore. The date format coming back is determined by the locale I set for myself on the BI Platform. If it's English, the date comes back e.g. 06/01/17 for Jun 1, 2017. If I change my BIP locale to Portuguese (Brazil), the date comes back as 01/06/17.

I wrote the dashboard to take the returned date and use the substring method to parse out the day, month, and year, which I then pass into the initialize method to get a REALDATE object. This method obviously won't work when the parts of the date string are in different places. I cannot find a way around this. Even using the getDay, getMonth, and getYear methods that are part of the REALDATE internals return the wrong values. Is there any way to use REALDATE to overcome this? Or any other method? Most of what I see from a Google search have to do with converting the current date, which isn't my situation.