Date errors in private cloud

Posted by Rollbase User on 03-Aug-2012 07:43

Hello, We're having errors using dates in our private cloud environment. (Hosted by us) The errors appear in triggers and formulas. The "rbv_api.getCurrentDate()" function as well as date fields such as "{!my_date}" return a french formated string, instead of the usual english string. Watch the following code : rbv_api.println(rbv_api.getCurrentDate()); rbv_api.println(new Date(rbv_api.getCurrentDate())); In debug mode, this prints : ven. août 03 2012 14:17:19 (CEST) Invalid Date It should print the following (which is the result we get from the environment hosted by Rollbase) : Fri Aug 03 2012 14:26:44 (CEST) Fri Aug 03 2012 14:26:44 GMT-0500 (CDT) Javascript Date function doesn't work if given a french date string as parameter. It has to be an english one, which is why we get the "Invalid date" error. This issue prevents our whole application from working correctly. We are using the following configur

All Replies

Posted by Admin on 03-Aug-2012 11:51

Any chance your server machine or local JDK uses French locale?



Any way, Rollbase API always returns an instance of JavaScript Date object. So you can call methods like genMonth() directly without converting to string.

Posted by Admin on 06-Aug-2012 11:24

Thank you for your answer, Pavel.



The server has been installed using French locale. I have changed it to English but we still have the same problem.



Do we absolutely have to set the system locale as well as the JDK to english?



I do not know how to set local JDK to use English locale instead of French locale. Please tell me if you know how.





You said that this should not have an impact since the Rollbase API returns an instance of Javascript Date.



We can only instantiate a Javascript Date from a field such as "{!date_field}" by doing the following (Plus, it is said in the Rollbase documentation to use dates as follow, and i cannot find another way around) :



var dt = new Date("{!date_field}");





The problem is already there!



The Javascript Date constructor expects an english "string formated date".



But in our case, both rbv_api.getCurrentDate() and "{!date_field}" field return a french "string formated date".



Since the JavaScript Date c

Posted by Admin on 06-Aug-2012 12:41

I'll do some research.

Posted by Admin on 06-Aug-2012 12:43

In the mean time try #iso option to force ISO dates format.

Posted by Admin on 06-Aug-2012 23:32

This will be fixed ASAP

Posted by Admin on 20-Aug-2012 11:09

Hello,



Did you find time to resolve this and do you know if it could be included in the next release?



After some other tests, we have found no other issue when transferring from hosted to private.



It all seems to work great besides that date problem.



Thanks again,

Romain PENNES

Posted by Admin on 20-Aug-2012 11:28

This should work fine now.

Posted by Admin on 20-Aug-2012 19:50

Hi Romain,



Are you planning to move entirely to Private Cloud?



Thanks,

Matt

Posted by Admin on 20-Aug-2012 19:51

Marking as resolved

Posted by Admin on 22-Aug-2012 06:59

Alright, we've updated to the latest version (3.7.4). After some tests, it seems to work now. Thanks.



Romain PENNES.

Posted by Admin on 22-Aug-2012 07:04

Hi Matt,



Yes, we plan to move entirely to Private Cloud in a few monthes. We still need to get our environment stable thought.



This will allow us to bypass a few limitations we've experienced using the hosted version. (For instance, executing too much triggers in a row etc.)



Romain PENNES.

This thread is closed