Difference between revisions of "Dates"

From Gramps
Jump to: navigation, search
(See also)
(23 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This page documents advanced features of GRAMPS dates.  
+
{{out of date}}
 +
This page documents advanced features of Gramps dates.  
  
 
= Dates =
 
= Dates =
  
Dates in 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.  
+
Dates in 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 3.0 looked like:
+
The Date Editor in Gramps 3.0 looked like:
  
 
[[Image:Date-selection.png]]
 
[[Image:Date-selection.png]]
  
In GRAMPS 3.1, we have added two features for dates:  
+
In Gramps 3.1, we have added two features for dates:  
  
 
* full support for '''dual dated''' dates
 
* full support for '''dual dated''' dates
Line 28: Line 29:
 
From [2]: "For example, England and the American colonies didn't officially accept the new calendar until 1752. Before 1752, the English government still observed March 25 as the first of the year, but most of the population observed January 1 as the first of the year. For this reason, many people wrote dates falling between January 1 and March 25 with both years..."
 
From [2]: "For example, England and the American colonies didn't officially accept the new calendar until 1752. Before 1752, the English government still observed March 25 as the first of the year, but most of the population observed January 1 as the first of the year. For this reason, many people wrote dates falling between January 1 and March 25 with both years..."
  
Sometimes, a dual date may appear as a fraction, as in this grave stone:
+
Sometimes, a dual date may appear as a fraction, as in this grave stone (170 and 3/4, which means 1703 and 1704):
  
 
[[Image:Gravestone.jpg]]
 
[[Image:Gravestone.jpg]]
Line 36: Line 37:
 
* 1721/2
 
* 1721/2
 
* 1719/20
 
* 1719/20
 +
* 1799/800
  
 
These slash-years can appear anywhere in a date that a regular year can appear.
 
These slash-years can appear anywhere in a date that a regular year can appear.
Line 60: Line 62:
 
* Feb 23, 1710/1 (Mar25)
 
* Feb 23, 1710/1 (Mar25)
  
Dates with new year day codes will be sorted appropriately. For example, using the Python Gramplet:
+
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 [[Python Gramplet]]:
  
 
<pre>
 
<pre>
 
> dates = ["Dec 31, 1720", "Jan 1, 1720", "Mar 1, 1720", "Mar 25, 1720", "Mar 26, 1720", "Dec 1, 1720"]
 
> dates = ["Dec 31, 1720", "Jan 1, 1720", "Mar 1, 1720", "Mar 25, 1720", "Mar 26, 1720", "Dec 1, 1720"]
> dates.sort(cmp=lambda a,b: cmp(Date(a).sortval, Date(b).sortval))
+
> dates.sort(key=lambda x: Date(x))
 
> dates
 
> dates
 
['Jan 1, 1720', 'Mar 1, 1720', 'Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Dec 31, 1720']
 
['Jan 1, 1720', 'Mar 1, 1720', 'Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Dec 31, 1720']
> dates.sort(cmp=lambda a,b: cmp(Date(a + " (Mar25)").sortval, Date(b + " (Mar25)").sortval))
+
> dates.sort(key=lambda x: Date(x + " (Mar25)"))
 
> dates
 
> dates
 
['Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Jan 1, 1720', 'Dec 31, 1720', 'Mar 1, 1720']
 
['Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Jan 1, 1720', 'Dec 31, 1720', 'Mar 1, 1720']
 
</pre>
 
</pre>
  
This creates a list of date strings. You can sort them by wrapping Date() around them, and using their sortval. In the first example, they have a normal, January through December ordering.
+
This creates a list of date strings. You can sort them by wrapping Date() around them and comparing 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.
 
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.
 +
 +
Likewise, date differences can also be made with this method. For example, consider the two dates, '''Jan 1, 1750''' and '''Dec 1, 1750'''. Without considering what was the first day of the year with normal sequencing, those dates are 11 months apart. However, if they are actually separated by the new year, then they are actually only a month apart, and the first follows the second:
 +
 +
<pre>
 +
> Date("Dec 1, 1750") - Date("Jan 1, 1750")
 +
11 months
 +
> Date("Dec 1, 1750 (Mar25)") - Date("Jan 1, 1750 (Mar25)")
 +
-1 month, -1 day
 +
</pre>
 +
 +
== Date Math ==
 +
 +
The Date object in 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)
 +
# for describing (eg, for describing an age)
 +
# for ranking (eg, for computing "record holding" spans)
 +
 +
=== Date Differences ===
 +
 +
When a date is subtracted from another, a Span is created. A date Span can be used for creating a textual representation of the difference. A Span can also be used for ranking the difference, including a minimum difference, and a maximum difference.
 +
 +
=== Date Comparisons ===
 +
 +
There are three methods for seeing if one date happened before another date:
 +
 +
# simple method: date1.sortval < date2.sortval
 +
# more sophisticated and expensive: date1.match(date2' "<")
 +
# more restrictive: date1.match(date2, "<<")
 +
 +
Likewise for seeing if two dates are the same:
 +
 +
# simple method: date1.sortval == date2.sortval
 +
# more sophisticated and expensive: date1.match(date2' "=")
 +
 +
and for seeing if one date happened after another date:
 +
 +
# simple method: date1.sortval > date2.sortval
 +
# more sophisticated and expensive: date1.match(date2' ">")
 +
# more restrictive: date1.match(date2, ">>")
  
 
= References =
 
= References =
Line 81: Line 125:
 
# http://www.genealogy.com/00000771.html
 
# http://www.genealogy.com/00000771.html
 
# http://en.wikipedia.org/wiki/New_Year
 
# http://en.wikipedia.org/wiki/New_Year
 +
 +
==Related Gramps bugs==
 +
# <s>{{bug|1133}}</s>: Dates in Event view do not display in chronological order
 +
# <s>{{bug|1834}}</s>: Dates do not respect new-year boundaries in history
 +
# <s>{{bug|1842}}</s>: Editing double-dated dates (slash) in GUI box loses slash
 +
# <s>{{bug|2260}}</s>: fractional year dates not interpreted correctly
 +
 +
= See also =
 +
* [[Mixed date]]
 +
* [[Match dates]]
 +
* [[Gramps_4.2_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_1#Editing_dates]]
 +
* [[Gramps_4.2_Wiki_Manual_-_Reports_-_part_2#Formatting_Dates]]
 +
 +
[[Category:Developers/General]]
 +
[[Category:Documentation]]

Revision as of 00:13, 25 August 2015

Gramps-notes.png This page's factual accuracy may be compromised due to out-of-date information. Please help improve the Gramps Wiki as a useful resource by updating it.

This page documents advanced features of Gramps dates.

Dates

Dates in 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 3.0 looked like:

Date-selection.png

In Gramps 3.1, we have added two features for dates:

  • full support for dual dated dates
  • ability to mark dates belonging to a year that did not begin on Jan 1

The second of these required a database change, as we now store a new code with each date to indicate the new year day. This now gives one the ability to better document dates in particular times and places in history.

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 data entry screen currently looks like:

DualDated.png

Dual Dated

Dual dated dates (also called "double dating", "slash dates", and sometimes "Old Style/New Style" dates) appear like Jan 23, 1735/6. Often mistaken as a year uncertainty, this actually has a specific historic meaning. The dual dated date represents a time when an area was in a transition between moving to January 1 as the beginning of the new year. Thus Jan 23, 1735/6 is an indication to make it clear what date is being referred to.

From [2]: "For example, England and the American colonies didn't officially accept the new calendar until 1752. Before 1752, the English government still observed March 25 as the first of the year, but most of the population observed January 1 as the first of the year. For this reason, many people wrote dates falling between January 1 and March 25 with both years..."

Sometimes, a dual date may appear as a fraction, as in this grave stone (170 and 3/4, which means 1703 and 1704):

Gravestone.jpg

Marking a date as dual dated can be done by simply putting a slash between the years. For example:

  • 1721/2
  • 1719/20
  • 1799/800

These slash-years can appear anywhere in a date that a regular year can appear.

Dual dated dates will be represented in the Julian calendar so their mon/day will be the same as that in the textual representation.

New Year's Day

As mentioned, many places changed from Julian to Gregorian at the same time they changed from a March 25 new year to a January 1 new year. As these are related, they are represented in similar manners. To indicate that a calendar is in Julian (or any other calendar) one only need put the calendar name in parenthesis after the date. For example:

  • January 15, 1750 (Julian)

Gregorian is the default and you need not indicate that. Likewise, to indicate the beginning of a year that is different from that of January 1, you use the following codes:

  • Jan1
  • Mar1
  • Mar25
  • Sep1

You can put that as the only item in parenthesis, or right after a calendar name (comma, and no space). For example:

  • Jan 20, 1865 (Mar25)
  • Jan 20, 1750 (Julian,Mar1)
  • Feb 23, 1710/1 (Mar25)

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 Python Gramplet:

> 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))
> 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)"))
> dates
['Mar 25, 1720', 'Mar 26, 1720', 'Dec 1, 1720', 'Jan 1, 1720', 'Dec 31, 1720', 'Mar 1, 1720']

This creates a list of date strings. You can sort them by wrapping Date() around them and comparing 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.

Likewise, date differences can also be made with this method. For example, consider the two dates, Jan 1, 1750 and Dec 1, 1750. Without considering what was the first day of the year with normal sequencing, those dates are 11 months apart. However, if they are actually separated by the new year, then they are actually only a month apart, and the first follows the second:

> Date("Dec 1, 1750") - Date("Jan 1, 1750")
11 months
> Date("Dec 1, 1750 (Mar25)") - Date("Jan 1, 1750 (Mar25)")
-1 month, -1 day

Date Math

The Date object in 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:

  1. for sorting (eg, for listing in a table)
  2. for describing (eg, for describing an age)
  3. for ranking (eg, for computing "record holding" spans)

Date Differences

When a date is subtracted from another, a Span is created. A date Span can be used for creating a textual representation of the difference. A Span can also be used for ranking the difference, including a minimum difference, and a maximum difference.

Date Comparisons

There are three methods for seeing if one date happened before another date:

  1. simple method: date1.sortval < date2.sortval
  2. more sophisticated and expensive: date1.match(date2' "<")
  3. more restrictive: date1.match(date2, "<<")

Likewise for seeing if two dates are the same:

  1. simple method: date1.sortval == date2.sortval
  2. more sophisticated and expensive: date1.match(date2' "=")

and for seeing if one date happened after another date:

  1. simple method: date1.sortval > date2.sortval
  2. more sophisticated and expensive: date1.match(date2' ">")
  3. more restrictive: date1.match(date2, ">>")

References

  1. http://en.wikipedia.org/wiki/Dual_dating
  2. http://www.genealogy.com/00000771.html
  3. http://en.wikipedia.org/wiki/New_Year

Related Gramps bugs

  1. 1133: Dates in Event view do not display in chronological order
  2. 1834: Dates do not respect new-year boundaries in history
  3. 1842: Editing double-dated dates (slash) in GUI box loses slash
  4. 2260: fractional year dates not interpreted correctly

See also