From 413de1312131aac85dcb086c73f4c4a326b66398 Mon Sep 17 00:00:00 2001 From: raylu Date: Mon, 21 Oct 2013 22:52:57 -0700 Subject: don't show :00 seconds the api always returns :00 --- web/api.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'web/api.py') diff --git a/web/api.py b/web/api.py index 87d262e..0f19d0c 100644 --- a/web/api.py +++ b/web/api.py @@ -6,12 +6,6 @@ import tornado.web from config import web as config import db.queries -class JSONDateEncoder(json.JSONEncoder): - def default(self, data): - if isinstance(data, datetime.datetime): - return str(data) - return super(JSONDateEncoder, self).default(data) - class APIHandler(tornado.web.RequestHandler): def set_default_headers(self): self.set_header('Access-Control-Allow-Origin', '*') @@ -22,7 +16,7 @@ class APIHandler(tornado.web.RequestHandler): def respond_json(self, data): self.set_header('Content-Type', 'application/json; charset=UTF-8') - for chunk in JSONDateEncoder(indent='\t').iterencode(data): + for chunk in json.JSONEncoder(indent='\t').iterencode(data): self.write(chunk) self.finish() -- cgit v1.2.3