去掉dataTime的格式化,因为格式化后moment.js不能识别为标准时间

This commit is contained in:
zemal
2017-07-15 23:18:07 +08:00
parent 8a60ea52bb
commit ee2f5f5dd7
3 changed files with 2 additions and 51 deletions

View File

@@ -4,7 +4,7 @@ from rest_framework import serializers
class DateTimeTZField(serializers.DateTimeField):
def to_representation(self, value):
self.format = "%Y-%-m-%d %H:%M:%S %Z"
# self.format = "%Y-%-m-%d %H:%M:%S %Z"
value = timezone.localtime(value)
return super(DateTimeTZField, self).to_representation(value)