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

Add birthDate field to align on the standard date format #481

Closed
wants to merge 1 commit into from

Conversation

cfraser
Copy link
Contributor

@cfraser cfraser commented Aug 20, 2018

Copy link
Collaborator

@fmeschbe fmeschbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see whether we find a good regex instead of format:date which does not cope with incomplete dates.

"xdm:birthDate": {
"title": "Birth Date",
"type": "string",
"format": "date",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the discussion, we don't want to have this to be date since the date might be incomplete. We discussed using a regular expression to match a date, so that we can be sure it is properly formatted.

Something along these lines:

"pattern": "([0-9X]{4}|XXXX)-([0-9]{2}|XX)-([0-9]{2}|XX)"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that pattern is an acceptable ISO format, is it not? If so, the date format is enough.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is @HyveMynd. The problem is how to deal with incomplete dates. For example, when we don't know the year.

@kstreeter
Copy link
Collaborator

Hey @cfraser (and @fmeschbe). My suggestion is that we have three distinct fields which capture the specific cases we have for birthday. I feel like this will make the interpretation of each field simpler:

  • xdm:birthDate - the full date, using the "date" format
  • xdm:birthDayAndMonth- the regex "XXXX-MM-DD" as @fmeschbe suggested
  • xdm:birthYear - the birth year, which can be used to compute age

I am a bit concerned about allowing partial dates in the same field as you would expect a full date. This puts a lot of burden on readers to handle partials, and won't allow standard tooling to expose full dates as standard data types (like the Java Date class).

@fmeschbe
Copy link
Collaborator

@kstreeter The main concern is indeed how to handle partial dates. The standard Java classes do not seem to be ready to support this case properly. So an unknown day could default to first, while an unknown month would become January, and an unknown year .... (I don't know).

But that is not of a concern for XDM as a transfer format, is it ?

@cfraser
Copy link
Contributor Author

cfraser commented Aug 29, 2018

Closing in lieu of #498.

@cfraser cfraser closed this Aug 29, 2018
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.

4 participants