0001-agora-allow-wcs-to-send-dates-formatted-as-Y-m-d-114.patch
passerelle/contrib/agoraplus/wcs.py | ||
---|---|---|
19 | 19 |
import datetime |
20 | 20 | |
21 | 21 |
def date_from_iso(s): |
22 |
utc = time.strptime(s, '%Y-%m-%dT%H:%M:%SZ') |
|
23 |
timestamp = calendar.timegm(utc) |
|
24 |
return datetime.date.fromtimestamp(timestamp).strftime('%Y-%m-%d') |
|
22 |
if 'T' in s: |
|
23 |
utc = time.strptime(s, '%Y-%m-%dT%H:%M:%SZ') |
|
24 |
timestamp = calendar.timegm(utc) |
|
25 |
return datetime.date.fromtimestamp(timestamp).strftime('%Y-%m-%d') |
|
26 |
else: |
|
27 |
return datetime.datetime.strptime(s, '%Y-%m-%d').date() |
|
25 | 28 | |
26 | 29 |
def booleanize(value): |
27 | 30 |
''' |
28 |
- |