Skip to content

Make DateTime validator always return a datetime#66

Merged
AlecRosenbaum merged 2 commits intomasterfrom
issue-45
Sep 13, 2022
Merged

Make DateTime validator always return a datetime#66
AlecRosenbaum merged 2 commits intomasterfrom
issue-45

Conversation

@AlecRosenbaum
Copy link
Copy Markdown
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