api: include iso formatted datetime in datetime APIs (#14514)
This commit is contained in:
parent
51bbc55b7f
commit
e5d44b42df
|
@ -78,6 +78,7 @@ class Datetimes(GenericAPIView):
|
|||
|
||||
response = {'data': [{'id': x.id,
|
||||
'text': unicode(x),
|
||||
'datetime': x.start_datetime.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'disabled': bool(x.full)} for x in entries]}
|
||||
return Response(response)
|
||||
|
||||
|
@ -128,7 +129,9 @@ class MeetingDatetimes(GenericAPIView):
|
|||
|
||||
entries.sort(key=lambda x: x.start_datetime)
|
||||
|
||||
response = {'data': [{'id': x.id, 'text': unicode(x)} for x in entries]}
|
||||
response = {'data': [{'id': x.id,
|
||||
'datetime': x.start_datetime.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'text': unicode(x)} for x in entries]}
|
||||
return Response(response)
|
||||
|
||||
meeting_datetimes = MeetingDatetimes.as_view()
|
||||
|
|
|
@ -124,6 +124,7 @@ def test_datetime_api_fr(app, some_data):
|
|||
resp = app.get('/api/agenda/%s/datetimes/' % agenda_id)
|
||||
# no seconds, hh:mm in 24-hour formats
|
||||
assert resp.json['data'][0]['text'].endswith(' 17:00')
|
||||
assert resp.json['data'][0]['datetime'].endswith(' 17:00:00')
|
||||
assert 'data' in resp.json
|
||||
|
||||
def test_datetime_api_label(app, some_data):
|
||||
|
|
Loading…
Reference in New Issue