Changes

Jump to: navigation, search

Dates

694 bytes added, 22:05, 18 March 2022
See also
[[Category:Developers/General]][[Category:Documentation]]{{stub}}This page documents advanced features of GRAMPS Gramps dates.
= Dates =
Dates in GRAMPS Gramps are much more complex than just a month, day, and year. Dates are always in a particular calendar, can span a time frame, can be approximate, and have support for many other subtleties specific to genealogy data.
;The Date Editor in GRAMPS Gramps 3.0 looked like:
[[ImageFile:Date-selection.png|left|thumb|450px|Date Editor in Gramps 3.0]]{{-}}In GRAMPS Gramps 3.1, we have added two features for dates:
* full support for '''dual dated''' dates
Some locations changed from the Julian calendar to the Gregorian calendar at the same time that they changed the new year from March 25 to January 1. However, in many places in the world these two events did not happen at the same time.
;The new Gramps 3.1 data entry screen currently looks like: [[Image:DualDated.png]]
[[File:DualDated.png|left|thumb|450px|Date Editor in Gramps 3.1]]
{{-}}
== Dual Dated ==
Sometimes, a dual date may appear as a fraction, as in this grave stone (170 and 3/4, which means 1703 and 1704):
[[ImageFile:Gravestone.jpg|left|thumb|450px]]{{-}}
Marking a date as '''dual dated''' can be done by simply putting a slash between the years. For example:
Note that if new year's day is not Jan 1, then January may come after December that year!
Dates with new year day codes will be sorted appropriately. For example, using the [[Addon:Python Shell Gramplet|Python Gramplet]]:
<pre>
> dates = ["Dec 31, 1720", "Jan 1, 1720", "Mar 1, 1720", "Mar 25, 1720", "Mar 26, 1720", "Dec 1, 1720"]
> dates.sort(key=lambda x: Date(x).sortval)
> dates
['Jan 1, 1720', 'Mar 1, 1720', 'Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Dec 31, 1720']
> dates.sort(key=lambda x: Date(x + " (Mar25)").sortval)
> dates
['Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Jan 1, 1720', 'Dec 31, 1720', 'Mar 1, 1720']
</pre>
This creates a list of date strings. You can sort them by wrapping Date() around them, and using their sortvalcomparing to another Date. In the first example, they have a normal, January through December ordering.
In the second example we append a " (Mar25)" after the date. Now when we sort, we see that the year begins with Mar, followed by all of the months up to Dec, then Jan, Feb and the first part of March is last.
== Date Math ==
The Date object in GRAMPS Gramps 3.1 has been enhanced in the way that dates are compared to one another. There are actually three different uses for comparing dates:
# for sorting (eg, for listing in a table)
# more sophisticated and expensive: date1.match(date2' ">")
# more restrictive: date1.match(date2, ">>")
 
 
= References =
# http://www.genealogy.com/00000771.html
# http://en.wikipedia.org/wiki/New_Year
# http://www.gramps-project.org/==Related Gramps bugs/view.php?id==# <s>{{bug|1133 - 0001133}}</s>: Dates in Event view do not display in chronological order # http://www.gramps-project.org/bugs<s>{{bug|1834}}</view.php?id=1834 - 0001834s>: Dates do not respect new-year boundaries in history # http://www.gramps-project.org/bugs<s>{{bug|1842}}</view.php?id=1842 - 0001842s>: Editing double-dated dates (slash) in GUI box loses slash # http://www.gramps-project.org/bugs<s>{{bug|2260}}</view.php?id=2260 - 0002260s>: fractional year dates not interpreted correctly = See also =* [[Gramps_Glossary#date|Gramps Glossary : Date]]* [[Mixed date|Support of mixed Julian/Gregorian calendar dates]]* [[Match dates|Matching dates in filters &amp; searches]]* [[Gramps_{{Version manual}}_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_1#Editing_dates|Data entry &amp; editing : Dates]]* [[Gramps_{{Version manual}}_Wiki_Manual_-_Reports_-_part_2#Formatting_Dates|Reports : Formatting dates]]* [[Date_Handler|Localization support : Date Handler]]* [[Test_date_handlers|Localization support : Test Date Handlers]]* [[Addon:Calculate Estimated Dates|Calculate Estimated Dates]] (tool addon)* [[Addon:DateCalculator|Date Calculator]] (Gramplet addon)  [[Category:Developers/General]][[Category:Documentation]]
1,971
edits

Navigation menu