* Abbreviated month name

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
pmolnar
Gold
Posts: 17
Joined: 20 Aug 2011 17:56
Family Historian: V6.2

Abbreviated month name

Post by pmolnar » 11 Aug 2021 15:23

Hi All,

I would like the birth dates to be displayed in the following format: YEAR ABBREVIATED_MONTH DAY
The built in date formats do not support this format, I tried to compile the date from fragments.
Is it possible to query the month name in abbreviated version? All I found is %INDI.BIRT.DATE:MONTH_NAME% that is the long variant.

https://imgur.com/rb7kUw8

Thanks

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 11 Aug 2021 15:31

I don't think that is possible in FH v6.2 but should be possible in FH v7.0 by using the =LeftText() function.
e.g.
=LeftText( %INDI.BIRT.DATE:MONTH_NAME%, 3 )

Where exactly do you want that date format to be displayed?
You mentioned querying the month name, so what is your query Expression?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
pmolnar
Gold
Posts: 17
Joined: 20 Aug 2011 17:56
Family Historian: V6.2

Re: Abbreviated month name

Post by pmolnar » 11 Aug 2021 15:40

Thanks for the reply

I would like to use it for diagrams so that the date consumes less space. I will try it in FH7 after I update to it.
I tried with this: %INDI.BIRT.DATE:YEAR% %INDI.BIRT.DATE:MONTH_NAME% %INDI.BIRT.DATE:DAY%
I think all I should do is to use your example.

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 11 Aug 2021 15:53

You can set Tools > Preferences > Preferred Short Date Format to such as yyyy/mm/dd all numeric format.
e.g. 2021/8/11
There is also yyyy.mm.dd and yyyy-mm-dd formats for year month day.
They are all even shorter than your yyyy mmm dd scheme.

Then in Diagram > Options > Text > Edit the Date Format can be set to Abbrev(3) to apply that Short Date Format.

I presume you are aware of all the Date Formats: https://www.family-historian.co.uk/help ... rmats.html?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
pmolnar
Gold
Posts: 17
Joined: 20 Aug 2011 17:56
Family Historian: V6.2

Re: Abbreviated month name

Post by pmolnar » 12 Aug 2021 07:20

Thanks, it works for me too. I was not aware of the date format possibilities in such a details but now I am.

Last question in this topic, can I force somehow that month and days are displayed in 2 digit format always like 2001.05.12 instead of 2001.5.12?

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 12 Aug 2021 09:17

No, that does not seem to be possible with any of the available date format settings.
You are not the first to have asked about that display mode.
It might be possible with complex use of functions, but I'm not sure.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Abbreviated month name

Post by Mark1834 » 12 Aug 2021 18:31

Frustratingly, that format is available in reports using functions, but I can't see any way of getting it into a diagram. I use this distinct format for Date Updated in reports so it is not mistaken for a fact date on a skim read.
Capture.PNG
Capture.PNG (24.57 KiB) Viewed 2382 times
Mark Draper

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 12 Aug 2021 19:28

How do you specify that date format in the report?
Are you simply using the =LastUpdated() function over which you have no control of the date format?
It does not honour the Tools > Preferences > Preferred Short Date Format setting.
I suspect it uses its own unique format.
Are you using the =MidText() function to extract the digits and recombining with the =Text() function?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 12 Aug 2021 21:21

Assume Tools > Preferences > Preferred Short Date Format has its default setting dd/mm/yyyy.
Then the following complex expression will yield the format yyyy-mm-dd with leading zeros where needed.

=RightText(%INDI.BAPM.DATE:ABBREV3%,4)-=RightText(Text("0".Section(%INDI.BAPM.DATE:ABBREV3%,2,"/")),2)-=RightText(Text("0".Section(%INDI.BAPM.DATE:ABBREV3%,1,"/")),2)

Breaking that down:
=RightText(%INDI.BAPM.DATE:ABBREV3%,4) extracts the rightmost 4 year digits.
=RightText(Text("0".Section(%INDI.BAPM.DATE:ABBREV3%,2,"/")),2) extracts 2nd section month digit(s), prefixed with "0", and yields the rightmost 2 digits that ensures a leading zero is included if necessary.
=RightText(Text("0".Section(%INDI.BAPM.DATE:ABBREV3%,1,"/")),2) does the same for 1st section day digit(s).

Thus 4/8/1900 will produce 1900-08-04
However, this only works for simple dates and not Period or Range dates, etc.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Abbreviated month name

Post by Mark1834 » 12 Aug 2021 21:29

You may recall that this was discussed at some length earlier this year. Jane pointed out that LastUpdated() returns the date as specified in the user's Windows Short Date Format, so it is not directly controllable from within FH. However, if you use =Date(LastUpdated()), you can format the individual elements as you choose.

The full formula for producing the ISO format of yyyy-mm-dd is

=Year(LastUpdated())-=TextIf(Month(LastUpdated())<10,"0")=Month(LastUpdated())-=TextIf(Day(LastUpdated())<10,"0")=Day(LastUpdated())

I can't claim any credit for that. It was actually you that devised the full version to include leading zeros, but after 22,000 posts, you're allowed not to remember them all :). Unfortunately for the OP, this only works in Reports, as Diagrams only allow dates in a predetermined FH format, not flexibly via functions.
Mark Draper

User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Abbreviated month name

Post by Mark1834 » 12 Aug 2021 21:31

Think we were both typing at the same time! I prefer your earlier version, as it is simpler.
Mark Draper

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Abbreviated month name

Post by tatewise » 12 Aug 2021 21:50

Thank you for reminding me of that earlier expression. For a fact date that becomes:
=Year(%INDI.BAPM.DATE%)-=TextIf(Month(%INDI.BAPM.DATE%)<10,"0")=Month(%INDI.BAPM.DATE%)-=TextIf(Day(%INDI.BAPM.DATE%)<10,"0")=Day(%INDI.BAPM.DATE%)
It is a bit simpler, copes with all forms of date, and works in FH v6.2 too.
So for Period and Range dates, it will show the first date of two dates.

Not sure why you say it won't work in Diagrams as functions are allowed to override the default Date format.
I have put exactly the above expression into a Text Scheme item Template and it works the same as in a Report.

One wrinkle I have spotted is that whereas =LastUpdated() always has a day & month, fact dates might not.
So dates may be produced such as 1900 and 1900-08 but that is probably OK.

Overall, that is a better outcome than I first predicted.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Abbreviated month name

Post by Mark1834 » 12 Aug 2021 22:31

Excellent, we got there in the end between us. I was hoping that as diagrams have a global setting for date format (unlike reports), it would be possible to customise that so it's done just once. That's what I was referring to, but yes, each separate fact can be customised individually. It's a fair bit of work, but it only has to be done once.
Mark Draper

Post Reply