Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search YAJL Parser created_at entry inconsistant with other results. #83

Open
averydev opened this issue Apr 9, 2011 · 0 comments
Open

Comments

@averydev
Copy link

averydev commented Apr 9, 2011

When results for a search are parsed with YAJL, the "created_at" key is returned as an NSCF Number instead of an NSDate.

Starting at line 81 in MGTwitterYAJLParser
the following code changes that:
if ([currentKey isEqualToString:@"created_at"])
{
// we have a priori knowledge that the value for created_at is a date, not a string

    NSDateFormatter *dateformat  = [[NSDateFormatter alloc] init];
        [dateformat setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]];
        dateformat.dateFormat = @"EEE, dd MMM yyyy HH:mm:ss ZZZZZ";

        NSDate *creationDate = [dateformat dateFromString:(NSString *)value];
        [self addValue:creationDate forKey:currentKey];
        [dateformat release];
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant