You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
changed the title
Please implement some order mechanism for date
DateInfo to GedcomxDate?
Jan 26, 2017
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.
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
, andYear
properties to theDateInfo
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.
The text was updated successfully, but these errors were encountered: