wikitree / wikitree-dynamic-tree

Dynamically generated and browsed graphical family tree
MIT License
24 stars 15 forks source link

Fix death date for living persons in `Printer Friendly` view #83

Closed MichalVasut closed 1 year ago

MichalVasut commented 1 year ago

It's not really pretty for living persons to show [unknown] as death date - show only date of birth.

As for birth date - fix also that - it could be restricted by privacy settings and shown only as decade ...

image image

https://apps.wikitree.com/apps/wikitree-dynamic-tree/#name=Schwarzenegger-1&view=printer-friendly

Sidenote - as a proud Czech, I must point that out! - check his great grand father and where he is from 👍 🇨🇿

image

harrislineage commented 1 year ago

Tagging @GeoffRiley since he is not showing up as an option for Assignee.

(Sorry for the tag Geoff - not enough caffeine yet this morning)

MichalVasut commented 1 year ago

Tagging @GeoffRiley since he is not showing up as an option for Assignee.

I can fix that, its my view and I would assign myself if I could (I don't have any option there, maybe not a team member, or not enough rights 🤔) - I've created the issue just because I don't have time now.

There is also another not really pretty thing I've found when previewed on smartphone - the main div (if I remember correctly, it has profiles ID) needs to set min-width let's say to 297mm (A4 paper bigger size) to show all profiles on small screen. Otherwise there is an issue with those at the sides.

harrislineage commented 1 year ago

I can fix that, its my view and I would assign myself if I could

Oh!! Sorry about that. Geoff made the family group sheet 🤦‍♂️

bcaseyrls commented 1 year ago

Dates on WikiTree are fuzzy. The dates themselves can be missing the day and/or month portion. For profiles limited by privacy, you might only have the rounded "BirthDateDecade" and "DeathDateDecade" fields. The dates also have DataStatus values. For BirthDate, these are "guess" (about/uncertain), "certain" (exact/certain), "before" (before this date), "after" (after this date), and "blank" (blank for extra privacy). For DeathDate we have similar values, but "guess" means "about/uncertain but non-living", and "blank" means "blank because still living".

So instead of "unknown" for an empty DeathDate field, we might want just empty string, because there is no death date. Or it might be known, but hidden, or known but limited to the Decade version. Or it might actually be unknown.

On the server side we have a "Fuzzy Date" version of birth/death date that gets used on some pages. This is formatted as "Month Day, Year" if we have all data, just "Month Year" if we don't have the day, and just "Year" if that's all we have. But that function doesn't take into account the DataStatus (though it is in various code and templates on the site).

Possibly a new handful of Derived value as available fields (https://github.com/wikitree/wikitree-api/blob/main/getProfile.md) would be useful. But if individual views want their own formatting of the dates, I think we'll need to handle all of these variations locally in the app rather than server-side.

GeoffRiley commented 1 year ago

The dates certainly cause a little headache… but nothing like the headache that would ensue if the date fields were as free format as people continue to ask for! If you haven't got the time to look at it @harrislineage, then I'm willing to tackle the dates for you.

It is the sort of thing that would ideally be pulled out into a sub-module within the window hierarchy to be more easily available to all. I could take a look at that instead if that's okay with you @bcaseyrls?

Clarke-11007 commented 1 year ago

I've got a function I created for the Fan Chart that spits out dates in multiple formats, based on what is available to start with - and the desired format requested. The one thing it doesn't do yet (which I was intending to add) was the qualifiers where appropriate (about / before / after). Death dates are left blank if still living or not available (though that might be a case where "d. Unknown" is more reflective of the truth if we know the person is deceased.

function is called getSettingsDateAndPlace(person, dateType) and it does also handle places at the same time, which was my use case.

Feel free to use / abuse it / or ignore it if you've already solved the problem! Again - an example of something that's probably happening multiple times across the various trees which we can tighten up eventually.

The dates certainly cause a little headache… but nothing like the headache that would ensue if the date fields were as free format as people continue to ask for! If you haven't got the time to look at it @harrislineage https://github.com/harrislineage, then I'm willing to tackle the dates for you.

It is the sort of thing that would ideally be pulled out into a sub-module within the window hierarchy to be more easily available to all. I could take a look at that instead if that's okay with you @bcaseyrls https://github.com/bcaseyrls?

— Reply to this email directly, view it on GitHub https://github.com/wikitree/wikitree-dynamic-tree/issues/83#issuecomment-1294195826, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3JDGBV7BODBS4HBIO4K3R3WFL7PJANCNFSM6AAAAAARP22BAE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

MichalVasut commented 1 year ago

I've already done almost the same with function wtDate, but there are still some nuances that I missed - especially privacy and its influence on dates...