calvinmetcalf/shapefile-js — pull request #8 by jimmyrocks (2013-06-16 23:11:44+00:00)
Title: Added code for the "D" datatype.

It looks like "D" for date is the only other datatype supported by shapefile dbf, so I added some code to deal with it. I made a shapefile/dbf in ArcMap in order to test all of its datatypes, so I can share that with you, but the only formats are C, N, and D. They also all appear to be stored as ASCII strings within the dbf file.

I did the data conversion the long way in order to deal with older browsers like IE9. I doubt this will be used on those older browsers, but I'd rather not introduce incompatibility where I don't have. If you can think of a better way to do this, I won't be offended if you change it.

This is the code:

```Javascript
return new Date(textData.substring(0,4), parseInt(textData.substring(4,6),10)-1, textData.substring(6,8));
```