Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

custom NSDate format #64

Open
JanC opened this issue Jan 3, 2014 · 4 comments
Open

custom NSDate format #64

JanC opened this issue Jan 3, 2014 · 4 comments

Comments

@JanC
Copy link

JanC commented Jan 3, 2014

Hi,
is there a way of setting a date formatter for parsing dates? In the JSON answer I'm getting, the dates are set as milliseconds since 1970 e.g.

"anniversary": 1388646266064

cheers

@supermarin
Copy link
Owner

@JanC there was a PR to expose the dateFormatter so people can set their own date format.
I think that one'll go into production

@CaseyB
Copy link

CaseyB commented Apr 16, 2015

I can override - (NSDateFormatter *)defaultFormatter in my NSManagedObject subclass but some of the fields have different formats within the same model. Any suggestions on overriding the date format per attribute?

@stephencelis
Copy link
Collaborator

@CaseyB Could you make your formats consistent? That would probably be ideal. If you need field-specific formats, you're best off overriding each attribute yourself and using the primitive getter/setters, etc.

@CaseyB
Copy link

CaseyB commented Apr 16, 2015

Unfortunately I don't have control over the format from the server. We were using MagicalRecord and it gave us the option to map a date format per attribute but it had a lot of other shortcomings. So far ObjectiveRecord is great, this is the only real snag I've hit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants