question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for partial Date

See original GitHub issue

Hi,

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).

Related SO question.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bytenikcommented, Apr 13, 2020

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.

0reactions
jskeetcommented, Dec 28, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found