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

Remove rounding when formatting a span #1301

Closed
wants to merge 1 commit into from
Closed

Remove rounding when formatting a span #1301

wants to merge 1 commit into from

Conversation

DaveSch-gramps
Copy link
Contributor

@DaveSch-gramps DaveSch-gramps commented Oct 10, 2021

Removes the +1 when the Age precision is set to 1 (Years) and the month is >= 6

Bug #12422

Removes the +1 when the Age precision is set to 1 (Years) and the month is >= 6

Bug #0012422
@Nick-Hall Nick-Hall changed the title Update date.py Remove rounding when formatting a span Feb 15, 2022
@Nick-Hall Nick-Hall added the bug label Feb 15, 2022
@Nick-Hall
Copy link
Member

This proposed fix reverts the change made for bug #8765.

The issue is that when calculating the length of a span, "about 1900" is taken as "1 Jan 1900" instead of a mid-point. This leads to the span "May 1900" to "about 1901" being displayed as "0 years" instead of "1 year" which may appear more reasonable.

@DaveSch-gramps
Copy link
Contributor Author

I just did a test

Birth = "May 1900"
Death = "about 1901"

about defined with default 50 years
PR 1301 NOT applied

Years = about 8 months
Years, Months = about 8 months
Years, Months, Days = about 8 months

PR 1301 applied

Years = about 8 months
Years, Months = about 8 months
Years, Months, Days = about 8 months

With PR 1301 still applied

Birth = "May 1900"
Death = "about 1950"

Years = about 49 years

All correct calculations

But going back to to my exact date scenario, with PR1301 not applied

Date of Birth: 1909-12-12
Date of Death: 1993-11-03

Age: 83y, 10m, 22d
Age: 83y, 10m
Age: 84y

My relative was not 84 when she died.

@Nick-Hall
Copy link
Member

The argument made in the original bug report (#8765) was that an incomplete date such as "1900" was on average more likely to represent an event happening nearer to 1 Jul 1900 than 1 Jan 1900.

The fix caused other issues though. With two exact dates the age is rounded up which is unexpected in some countries. In England, using the example above, we would refer to a person as 83 years old even if they had lived for 83y, 10m, 22d.

However, this may not be the case in all countries, so perhaps we should make this an option as @SNoiraud suggests in bug report #12422.

@DaveSch-gramps
Copy link
Contributor Author

Personally, I use Year, Month, Day as my setting but I did notice it was rounding up when I first migrated to Gramps. Odd that the setting in Preferences is "Age display precision:"

I have no strong opinion that the code needs to be changed. If you (and/or others) feel this pull should be closed, I will not be disappointed.

@Nick-Hall
Copy link
Member

In general, rounding a span seems like a good idea. When the span represents an age, then rounding may not be appropriate and perhaps should be made optional.

I'll leave this open for now and think about it further.

@Nick-Hall Nick-Hall added string Requires string changes and removed string Requires string changes labels Jul 14, 2023
@Nick-Hall Nick-Hall marked this pull request as draft July 17, 2023 22:24
@DaveSch-gramps
Copy link
Contributor Author

Closing PR in favor of @SNoiraud 's PR

#1615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants