Commit 37d137d3 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Only apply date formatting if column is datetime type

parent 34530b3b
......@@ -89,12 +89,13 @@ def formatColumn(col,
# fall back to date/time formatting
# if relevant for this column
if formatter is None:
if vtype == util.CTYPES.date:
formatter = dateFormat
elif vtype == util.CTYPES.time or \
pdtypes.is_datetime64_any_dtype(series):
formatter = timeFormat
if formatter is None and pdtypes.is_datetime64_any_dtype(series):
# use dateFormat if we know the column
# is a date (and not datetime), otherwise
# use timeFormat if the column is a
# datetime, or unknown type.
if vtype == util.CTYPES.date: formatter = dateFormat
else: formatter = timeFormat
if formatter is not None:
log.debug('Formatting column %s%s with %s formatter',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment