File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,10 @@ def __init__(self, **kwargs):
110
110
super ().__init__ (** kwargs )
111
111
112
112
def _parse_date (self , value , setting_format , iso_parse_func ):
113
- # Parse format is DRF output format: DATETIME_FORMAT, DATE_FORMAT or TIME_FORMAT
114
- parse_format = getattr (drf_settings , setting_format )
113
+ # Parse format is Field format if provided.
114
+ drf_format = getattr (self .drf_field , "format" , None )
115
+ # Otherwise, use DRF output format: DATETIME_FORMAT, DATE_FORMAT or TIME_FORMAT
116
+ parse_format = drf_format or getattr (drf_settings , setting_format )
115
117
# Use the provided iso parse function for the special case ISO_8601
116
118
if parse_format .lower () == ISO_8601 :
117
119
return iso_parse_func (value )
You can’t perform that action at this time.
0 commit comments