Web based family history software

This Help forum is for issues relates to the latest release (1.7.9). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

Question using specific part of $fact->getGedcom()

  • pfelix
  • Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 8 months ago #1 by pfelix
Inthe individual.php page, how can I use a specific part of $fact->getGedcom() like BIRT

For example, I want to display only the Month of the DATE or the Houre of TIME !!!
How can I do .... I've tried several thing but ... no succes !

1 BIRT
2 DATE 08 FEB 1979
3 TIME 11:05
2 NOTE Detail of the note
2 PLAC Paris
3 MAP

Thanks for your help !

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #2 by fisharebest
Replied by fisharebest on topic using specific part of $fact->getGedcom()
To get the date, use $fact->getDate()

To format a date as a month, use $fact->getDate()->display(false, 'F', false)

(See www.php.net/manual/en/function.date.php for the format codes: F=month)

To extract raw data at level 2, use $fact->getAttribute('DATE')

To extract raw data at level 3, you must process $fact->getGedcom() yourself.

You can examine the code here github.com/fisharebest/webtrees/blob/1.7/app/Fact.php

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}