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."
  • Page:
  • 1

TOPIC:

using specific part of $fact->getGedcom() 1 year 8 months ago #1

  • pfelix
  • pfelix's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
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.

using specific part of $fact->getGedcom() 1 year 8 months ago #2

  • fisharebest
  • fisharebest's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 14403
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 - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

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

  • Page:
  • 1
Powered by Kunena Forum