Send NSDate to rails

56 views
Skip to first unread message

Augustus Costa

unread,
Mar 2, 2011, 3:04:40 PM3/2/11
to objectiv...@googlegroups.com
I have in my entity some NSDate properties and NSDate with time properties.
When I do [MyEntity saveRemote] I had some problem with the date format when it arrives in rails.

I'm doing this:


toReturn.date = [[NSDate alloc] init]


I found this and I'm wanna use some help methods like this.


Is that the best way? I think this is too much work.
--
Augustus Costa
Sagarana Tecnologia
Mobile +55(85)8139.2679
Desk    +55(85)3304.6549

Augustus Costa

unread,
Mar 19, 2011, 9:08:17 PM3/19/11
to ObjectiveResource
Some Dates come nil. I found a formater problem but my skils in ROR is
low and I still with the problem.


XML :

<category-id type="integer">3</category-id>
<created-at type="datetime" nil="true"></created-at>
<customer-id type="integer">16</customer-id>
<datafinish type="date" nil="true"></datafinish>
<date type="date">2010-12-06</date> //PROBLEM
<finish-obs></finish-obs>
<hourstart type="datetime">2000-01-01T00:00:00Z</hourstart> //OK
<hourstop type="datetime">2000-01-01T00:00:00Z</hourstop> //OK
<id type="integer">1</id>
<kmstart type="float">0.0</kmstart>
<kmstop type="float">0.0</kmstop>
<media-id type="integer">2</media-id>
<obs>Sr.Daniel passou email solicitando elaborar or&#231;amento e
encaminhar para cliente.</obs>
<status>Pendente</status>
<updated-at type="datetime">2010-02-09T23:51:22-02:00</updated-at> //
PROBLEM
<user-id type="integer">3</user-id>




For this line.
<date type="date">2010-12-06</date> //PROBLEM

the method in ObjectiveResourceDateFormatter called is

+ (NSDate *)parseDateTime:(NSString *)dateTimeString

shoulden't be this

+ (NSDate *)parseDate:(NSString *)dateString

???


On Mar 2, 5:04 pm, Augustus Costa <augustusco...@gmail.com> wrote:
> I have in my entity some NSDate properties and NSDate with time properties.
> When I do [MyEntity saveRemote] I had some problem with the date format when
> it arrives in rails.
>
> I'm doing this:
>
> toReturn.date = [[NSDate alloc] init]
>
> I found this and I'm wanna use some help methods like this.
>
> https://github.com/yfactorial/objectivesupport/blob/d8116468d37b231b3...
Reply all
Reply to author
Forward
0 new messages