Parsing a legacy Date format

Jan 6, 2011 at 7:51 PM

I'm trying to use Json.NET to deserialise JSON with a legacy date storage format, which looks something like this:

 

{ "MyDate" : Date.Parse("12 Jan 2000") }

The problem seems to be that the lexer can't tokenise the static "Date.Parse" method, so I can't just consume extra tokens like the JavaScriptDateTimeConverter.

My plan at the moment is to extend lexer so that it can handle these tokens, then try to submit a patch back into Json.NET.

Is there a better way to go about parsing this date format?

Thanks,

Douglas

Coordinator
Jan 8, 2011 at 2:14 AM

Parsing that JSON starts to get quite complex. If you can do it in a nice way with good performance I'd be interesting in taking a look at what you do but no guarantees. It is an edge case and I don't want to make big changes for it.