去掉dataTime的格式化,因为格式化后moment.js不能识别为标准时间
This commit is contained in:
1 parent
8a60ea52bb
commit
ee2f5f5dd7
3 files changed
+2
-51
No files matched your search
@@ -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