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

DateInfo to GedcomxDate? #42

Open
weitzhandler opened this issue Jan 24, 2017 · 3 comments
Open

DateInfo to GedcomxDate? #42

weitzhandler opened this issue Jan 24, 2017 · 3 comments

Comments

@weitzhandler
Copy link
Contributor

weitzhandler commented Jan 24, 2017

Hi,

There should be a unified way to extract an object-oriented date value for ordering purposes from a DateInfo class.

I'd say you should add Day, Month, and Year properties to the DateInfo class, that will return the year parsed out from the date (maybe via regex). Actually having these properties as read-write would be very nice too.
I think the DateInfo lacks some manipulation functionality such as dealing with partial dates, as well as conversion to and from .NET DateTime when possible.

UPDATE,
And the truth is that it's all in the GedcomxDate library, there is just no connection between the two.

@misbach
Copy link
Contributor

misbach commented Jan 24, 2017

@weitzhandler Please feel free to contribute to this project. We accept pull requests :-).

@weitzhandler
Copy link
Contributor Author

The library itself looks pretty extensive. I just can't seem to find a connection between DateInfo and GedcomxDate, why isn't there a property on the DateInfo class that returns the date (or date-time) as a GedcomxDate?

@weitzhandler weitzhandler changed the title Please implement some order mechanism for date DateInfo to GedcomxDate? Jan 26, 2017
@JoergHoffmannatGitHub
Copy link
Contributor

You can use
dateInfo.SetFormal(gedcomxDate.FormalString());
in one direction, or
gedcomxDate = GedcomxDateUtil.Parse(dateInfo.Formal);
in the other direction.

Feel free to add convinience methods. I personally prefer not to have additional project dependency.

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

No branches or pull requests

3 participants