coerce_to_pendulum() was returning a naive pendulum DateTime if given a standard python datetime.date object. This is because:
The datetime.date object has no concept of time zone
The call to Pendulum DateTime.combine() to add the time component returns a naive Pendulum DateTime
pendulum.instance() ignores the tz argument if given a Pendulum DateTime
This fix replaces the call to Pendulum DateTime.combine()with the standard python datetime.combine(), which means that the tz argument won't be ignored
coerce_to_pendulum()
was returning a naive pendulumDateTime
if given a standard pythondatetime.date
object. This is because:datetime.date
object has no concept of time zoneDateTime.combine()
to add the time component returns a naive PendulumDateTime
pendulum.instance()
ignores thetz
argument if given a PendulumDateTime
This fix replaces the call to Pendulum
DateTime.combine()
with the standard pythondatetime.combine()
, which means that thetz
argument won't be ignored