Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
funpack
Commits
37d137d3
Commit
37d137d3
authored
May 12, 2020
by
Paul McCarthy
🚵
Browse files
BF: Only apply date formatting if column is datetime type
parent
34530b3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
funpack/exporting.py
View file @
37d137d3
...
...
@@ -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'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment