Make a ISO date time string human friendly. :type value: ``str`` :rtype: ``str``
(value, timezone=None)
| 41 | |
| 42 | |
| 43 | def format_isodate(value, timezone=None): |
| 44 | """ |
| 45 | Make a ISO date time string human friendly. |
| 46 | |
| 47 | :type value: ``str`` |
| 48 | |
| 49 | :rtype: ``str`` |
| 50 | """ |
| 51 | if not value: |
| 52 | return "" |
| 53 | |
| 54 | # For some reason pylint thinks it returns a tuple but it returns a datetime object |
| 55 | dt = dateutil.parser.parse(str(value)) |
| 56 | |
| 57 | if timezone: |
| 58 | dt = dt.astimezone(TZ(timezone)) |
| 59 | |
| 60 | value = format_dt(dt) |
| 61 | return value |
| 62 | |
| 63 | |
| 64 | def format_isodate_for_user_timezone(value): |