(core) Convert datetime objects in Date columns to timestamps at midnight of the date

Summary: Changes Date.do_convert to fix a bug noticed in https://grist.slack.com/archives/C069RUP71/p1643044498033400

Test Plan: Existing tests, and tested manually that the use case with the summary table was fixed

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3233
pull/124/head
Alex Hall 2 years ago
parent a685707d50
commit 8aa6ddba0b

@ -287,7 +287,7 @@ class Date(Numeric):
if value in ("", None):
return None
elif isinstance(value, datetime.datetime):
return moment.dt_to_ts(value)
return moment.date_to_ts(value.date())
elif isinstance(value, datetime.date):
return moment.date_to_ts(value)
elif isinstance(value, (float, six.integer_types)):

Loading…
Cancel
Save