metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinay Agrawal <vagra...@xebia.com>
Subject RE: [PATCH] Fix for bug in Salesforce DATE object formatting/parsing
Date Mon, 26 Aug 2013 04:51:36 GMT
Thanks for explanation Kasper.

+1 for this change

Regards

Vinay Agrawal* Senior Consultant
Xebia IT Architects India Private Limited
612 * BPTP Park Centra * Sector 30 * Gurgaon 122002 * Haryana * INDIA
mobile* 9958600483 Email*vagrawal@xebia.com

________________________________________
From: Kasper Sørensen [i.am.kasper.sorensen@gmail.com]
Sent: Sunday, August 25, 2013 11:09 PM
To: dev@metamodel.incubator.apache.org
Subject: Re: [PATCH] Fix for bug in Salesforce DATE object formatting/parsing

Hi Vinay,

Ah yes good points to address. I would agree if this had anything to
do with the user's perspective on the data - then Locale should be
externalized. But the changes with adding Locale to the
SimpleDateFormats used in the salesforce module are applied not to the
users data, but to the data that is interchanged with Salesforce. The
reason is that Salesforce sends and recieves date values as strings,
and these strings are formatted in a particular format - and using
english locale for e.g. weekday and month names. So the hardcoded
Locale is hardcoded specifically because we are formatting and parsing
date strings at the protocol layer, which is "behind the curtains" for
a MetaModel user.

2013/8/23 Vinay Agrawal <vagrawal@xebia.com>:
> Hi Kasper,
>
>
> My only concern with this fix is that we are restricting users to use Locale as English
. We rather should have a way for a user to set the locale for the complete metamodel ( e.g.
dataContext.setLocale(Locale.XYZ) ) and then we can use that Locale over here. Also default
> Locale can be set as Locale.english
>
> Thoughts ?
>
> Thanks
>
> Vinay Agrawal* Senior Consultant
> Xebia IT Architects India Private Limited
> 612 * BPTP Park Centra * Sector 30 * Gurgaon 122002 * Haryana * INDIA
> mobile* 9958600483 Email*vagrawal@xebia.com
>
> ________________________________________
> From: Kasper Sørensen [i.am.kasper.sorensen@gmail.com]
> Sent: Friday, August 23, 2013 7:06 PM
> To: dev@metamodel.incubator.apache.org
> Subject: Re: [PATCH] Fix for bug in Salesforce DATE object formatting/parsing
>
> Forgot to add - please review and vote if you agree on the patch :-)
>
> 2013/8/23 Kasper Sørensen <i.am.kasper.sorensen@gmail.com>:
>> Here's a patch for the issue with DATE objects, just mentioned [1]:
>> https://gist.github.com/kaspersorensen/6319391
>>
>> [1] Email thread "Date format to insert in salesforce":
>>
>> "In the salesforce module we always convert incoming Date values
>> using a SimpleDateFormat with the UTC timezone. This is because SF
>> saves the dates in UTC, so we have to ensure we don't wrongly send a
>> date in the wrong format. All well. But a problem is that we also do
>> this (apply timezone) for DATE columns, which are columns that don't
>> have any time-of-day information (like a birthdate). In such scenarios
>> we should not apply a timezone since it may change the actual date
>> that we're submitting to SF. This is a bug which I'll post a patch for
>> shortly."

Mime
View raw message