Closed GuyKh closed 6 months ago
The dates didn't parse correctly for me in the Thomas Krysinski example. The normal JS date parse will assume dates and it works off a 0-11 month calculation if I recall. In any case, when I parse Thomas, it gives me these dates. Birth: December 31, 1944
, Death: November 30, 1992
, when the real info is 1945 - December 1992
.
I'd suggest maybe trying to use the parseDate function in the popup.js and if you wanted to format it.. maybe something like this?
function displayDate(vardate) {
let formattedDate = ""
if ("day" in vardate && "month" in vardate && "year" in vardate) {
let date = moment({ year: vardate["year"], month: vardate["month"] - 1 , day: vardate["day"] });
formattedDate = date.format("MMMM D, YYYY");
} else if ("month" in vardate && "year" in vardate) {
let date = moment({ year: vardate["year"], month: vardate["month"] - 1 })
formattedDate = date.format("MMMM YYYY");
} else if ("year" in vardate){
let date = moment({ year: vardate["year"]});
formattedDate = date.format("YYYY");
}
return formattedDate;
}```
Perhaps it takes into account some locale of the browser
@eljeffeg see changes
By the way, Interesting thing to find: there's a github extension for WikiTree - where they face the same problems as we do: wikitree-sourcer
Worth taking a look when thinking about other problems too
@eljeffeg i think it's ready
Whoops, cross the streams on my work account. I'll take a look this weekend. Are we ready with #115 & #112 as well or holding off on them?
No.
@eljeffeg - requesting your attention :)
TL;DR for every profile - (e.g. Thomas F Krysinski) there's a part of the HTML with a json with the details.
Load this and use it instead of HTML parsing - this way -- add support to new BillionGraves
Solves #116 , Solves #106