Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DateTime validator always return a datetime #66

Merged
merged 2 commits into from
Sep 13, 2022
Merged

Conversation

AlecRosenbaum
Copy link
Contributor

@AlecRosenbaum AlecRosenbaum commented Sep 12, 2022

Closes: #45

This change adds a kwarg to disable converting datetime's to date's during validation if there's no time specified within the source string. Eventually this should be default behavior, but to avoid a breaking change it's just opt-in for now.

A commit is cherry picked from #65, then some minor refactors (mostly to code style/naming) are made in a followup commit.

mbdaryanto and others added 2 commits September 12, 2022 15:52
add no_time_as_date args with default to False, to switch to old behaviour by setting to True, if False always return datetime if True return date when no time in the input
@AlecRosenbaum AlecRosenbaum requested a review from tsx September 12, 2022 20:13
@AlecRosenbaum AlecRosenbaum merged commit 55deded into master Sep 13, 2022
@AlecRosenbaum AlecRosenbaum deleted the issue-45 branch September 13, 2022 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateTime should always return a datetime.datetime
3 participants