Skip to content

PartialDate Type #51285

Answered by tarekgh
myokeeh asked this question in Ideas
Apr 14, 2021 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

@myokeeh I don't think having partial date type make sense. In your scenarios, you can create DateOnly object with the default values of the missing date part. For example, if you have year and month without a day, you create DateOnly(year, month, 1). you can apply this for any case that is missing the date part. Doing that will allow you to perform the needed calculations.

If you can send more details about the exact scenario, you are using this partial dates and what calculations you are doing on that partial date, that can help understand what you need. doing Date calculation on dates missing parts will not make sense.

To give some example why partial date doesn't make sense, imagine y…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@danmoseley
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by danmoseley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants