Support for partial Date
See original GitHub issueHi,
Please add a type that enables nullable portions of date, for example, we should be able to set ‘month’ and ‘day’, while leaving ‘year’ null (e.g. Anniversary: 21 May), or set only ‘year’ (e.g. Born 1912), or ‘year’ and ‘month’ only (Died in May 1972) while the rest is null.
I always bump in the need for this when dealing with genealogical data, or optional date data (e.g. birth or death date), where we have to give the user to choice of what data is available to them.
You might want to consider partial-time, and partial-date, then partial date-time that comprises of the two.
Once there, it’d be beneficial to have ranges too: DateRange(PartialDate rangeStart, PartialDate rangeEnd)
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Help me please (partial dates)
I want the age field to show me their age only when I have a complete date of birth (DD/MM/YYYY) and to show...
Read more >What function can fill the partial date and partial datetime
Solved: Dears, I have a partial date like "2002" ,Is there any function that can fill in "2002" as "2002-01-01"? And.
Read more >Java date and time API - Partial
A partial in Joda-Time is a partial date and time representation. All implementations represent local dates and times, and do not reference a...
Read more >Partial Date
One FAPI element that supports a singular date time values and the corresponding range approximation lists.
Read more >Partial dates and full dates under one variable
I have a variable which containts full dates (31/01/2018), partial dates (2018-01) and missing dates. I'm not interested in missing dates ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wrote the original StackOverflow question. And while in the last 6 years I’ve trended more towards TypeScript development than C#, every time I work in C# I end up using Noda Time, and every time I end up working with Noda Time I end up bumping into this same issue. I think the main functionality beyond the storage type itself would be comparisons with a concrete
Instant
. Things like YearMonth and AnnualDate help, but, sometimes both a fully specified time or part of one are both permissible. An example is birthday; perhaps I want to store a user’s full birthday, but for some people I only have birth month and year. Regardless, I want certain logic to happen during a user’s birth month.Closing for now, as I don’t expect to do anything on this - I’m not convinced there’s a sufficiently general set of operations we’d want to expose.