Using angular.js with Tastypie for Django

The following angular.js service will allow you to consume a standard TastyPie REST API. As you may know, TastyPie returns its JSON objects a bit differently from what angular expects, so this service fixes it. This example assumes that you have always_return_data=True in your resource. This is the resource I used with this example: class […]

How to parse a JSON date with Javascript

Parsing a JSON date is rather easy, and doesn’t even require jQuery. Since the JSON date format is always the same, you can use substr to retrieve the timestamp and parse it to a date. var date = new Date(parseInt(jsonDate.substr(6))); There’s nothing more to it; it’s that easy!