去掉dataTime的格式化,因为格式化后moment.js不能识别为标准时间
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user