* Does not display date in ABBREV3 format
Does not display date in ABBREV3 format
Hi,
I use my individual Lithuanian language pack in diagrams. But I can't change the dates into ABBREV3 format. It always shown as LONG.
For example I changed CTA to 3SA:
=FactText(%INDI.BIRT[1+]%,"3SA","E_Born: _ in _")
but the result is the same: Born: 1852 m. sausio 23 d. (in English: 23 January 1852)
The same situation is using German or French diagram languages.
What should I do to display the date in the diagrams as 1852-01-23?
I use my individual Lithuanian language pack in diagrams. But I can't change the dates into ABBREV3 format. It always shown as LONG.
For example I changed CTA to 3SA:
=FactText(%INDI.BIRT[1+]%,"3SA","E_Born: _ in _")
but the result is the same: Born: 1852 m. sausio 23 d. (in English: 23 January 1852)
The same situation is using German or French diagram languages.
What should I do to display the date in the diagrams as 1852-01-23?
- tatewise
- Megastar
- Posts: 28488
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Does not display date in ABBREV3 format
Welcome to the FHUG.
The translation of Dates is handled by the Language Pack Plugin in its FH_GetDateText function.
You have already modified the Plugin for the Lithuanian language but the Plugin template supplied by Calico Pie does not handle Date qualifiers/formats and only produces standard Date format. So you must modify the Plugin further to cater for the Date formats you require.
The translation of Dates is handled by the Language Pack Plugin in its FH_GetDateText function.
You have already modified the Plugin for the Lithuanian language but the Plugin template supplied by Calico Pie does not handle Date qualifiers/formats and only produces standard Date format. So you must modify the Plugin further to cater for the Date formats you require.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Mark1834
- Megastar
- Posts: 2534
- Joined: 27 Oct 2017 19:33
- Family Historian: V7
- Location: South Cheshire, UK
Re: Does not display date in ABBREV3 format
Be aware that AFAIK there is no easy way to make FH display dates in that yyyy-mm-dd ISO form unless it is already defined as your Windows format. You have to create a very convoluted function to assemble the various parts and keep leading zeros.
IMO, that is a significant shortcoming, as it is the only numeric date format that is globally unambiguous.
IMO, that is a significant shortcoming, as it is the only numeric date format that is globally unambiguous.
Mark Draper
Re: Does not display date in ABBREV3 format
Thank you, I understand now.
Can I copy a whole text of FH_GetDateText function from English (ENG) Calico Pie V1.1 Language Pack Plugin and modify it? Because the text is different in my Plugin (and in other languages of Calico Pie Language Packs).
Or there is more complex situation?
Can I copy a whole text of FH_GetDateText function from English (ENG) Calico Pie V1.1 Language Pack Plugin and modify it? Because the text is different in my Plugin (and in other languages of Calico Pie Language Packs).
Or there is more complex situation?
Re: Does not display date in ABBREV3 format
Thank you. My Windows system format is 2023-06-19. I usually use two types of dates in FH. One exact (I want that format for this type) and all other dates can be as is (with months names, phrases etc.).
- tatewise
- Megastar
- Posts: 28488
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Does not display date in ABBREV3 format
I don't think Mark is entirely correct about the yyyy-mm-dd format.
Tools > Preferences > General > Preferred Short Date Format: yyyy-mm-dd is used when ABBREV3 format is chosen.
The snag is that it omits leading zeros in the month and day components so 1st Jan 1900 is 1900-1-1 which does not sort correctly with other dates when rendered as plain text. However, in Diagrams that is not a problem.
Further date formatting discussions continue in FH Short Date and ISO Format (22013).
Yes, the English Language Pack seems to cater for Date Qualifiers such as ABBREV3 so you should be able to use that in conjunction with your Lithuanian translations which are needed for other Date Qualifiers or no qualifiers.
You will need to use components from the FH_GetDateText function that handle ABBREVn formats and add functions such as GetDatePeriodOrRangeAbbrev.
Tools > Preferences > General > Preferred Short Date Format: yyyy-mm-dd is used when ABBREV3 format is chosen.
The snag is that it omits leading zeros in the month and day components so 1st Jan 1900 is 1900-1-1 which does not sort correctly with other dates when rendered as plain text. However, in Diagrams that is not a problem.
Further date formatting discussions continue in FH Short Date and ISO Format (22013).
Yes, the English Language Pack seems to cater for Date Qualifiers such as ABBREV3 so you should be able to use that in conjunction with your Lithuanian translations which are needed for other Date Qualifiers or no qualifiers.
You will need to use components from the FH_GetDateText function that handle ABBREVn formats and add functions such as GetDatePeriodOrRangeAbbrev.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: FH Short Date and ISO Format
For example in Lithuania we use ISO standard, so we always know what means 2023-01-02 (yyyy-mm-dd).
Thank you for the discussion.
I hope the several lines in my Plugin will help to translate FH date format into ISO date format.
For example:
if iDay >= 1 and iDay <= 9 then
sDay = '0' .. iDay;
else
sDay = iDay;
end
if iMonth >= 1 and iMonth <= 9 then
sMonth = '0' .. iMonth;
else
sMonth = iMonth;
end
Let me know please, if I am on wrong way.
Thank you for the discussion.
I hope the several lines in my Plugin will help to translate FH date format into ISO date format.
For example:
if iDay >= 1 and iDay <= 9 then
sDay = '0' .. iDay;
else
sDay = iDay;
end
if iMonth >= 1 and iMonth <= 9 then
sMonth = '0' .. iMonth;
else
sMonth = iMonth;
end
Let me know please, if I am on wrong way.
- tatewise
- Megastar
- Posts: 28488
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Does not display date in ABBREV3 format
Yes, that looks like the correct approach.
If when you test it you have any problems then post here again.
On closer inspection, the following would be better to cope with no Day or no Month in Date:
if iDay >= 1 and iDay <= 9 then
sDay = '0' .. iDay;
elseif iDay > 9 then
sDay = iDay;
end
if iMonth >= 1 and iMonth <= 9 then
sMonth = '0' .. iMonth;
elseif iMonth > 9 then
sMonth = iMonth;
end
If when you test it you have any problems then post here again.
On closer inspection, the following would be better to cope with no Day or no Month in Date:
if iDay >= 1 and iDay <= 9 then
sDay = '0' .. iDay;
elseif iDay > 9 then
sDay = iDay;
end
if iMonth >= 1 and iMonth <= 9 then
sMonth = '0' .. iMonth;
elseif iMonth > 9 then
sMonth = iMonth;
end
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- tatewise
- Megastar
- Posts: 28488
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Does not display date in ABBREV3 format
You may be interested in the Language Pack English (ENG RPRT) Mike Tate that I have just published in the Plugin Store.
It has existed as an attachment to Language Pack can alter English Report labels (19841) for some time but I have updated it to cater for most Date Formats in both Reports and Diagrams.
It handles Format Qualifiers on Date fields, Report and Diagram Options settings for Date Format, the FactText(...) function Date Format options, and the Tools > Preferences > General tab settings for Preferred Standard/Short Date Format.
So if a Date has the ABBREV3 Qualifier or the Date Format is set to Abbreviated (3), and the Preferred Short Date Format is set to yyyy-mm-dd, then the ISO Date Format is produced with leading zeros where necessary.
That is all handled in the Plugin script where the Date functions are derived from the English (ENG) Calico Pie Language Pack and modified to handle extra format options:
On Line 14:
require "luacom";
About Line 55:
g_date_stand_form = "ddmmmyyyy";
g_date_short_form = "dd/mm/yyyy";
g_date_short_sep = "/"
Changes and additions:
function FH_LangPackBegin(...)
function GetRegKey(strKey)
function GetDatePtText(...)
It has existed as an attachment to Language Pack can alter English Report labels (19841) for some time but I have updated it to cater for most Date Formats in both Reports and Diagrams.
It handles Format Qualifiers on Date fields, Report and Diagram Options settings for Date Format, the FactText(...) function Date Format options, and the Tools > Preferences > General tab settings for Preferred Standard/Short Date Format.
So if a Date has the ABBREV3 Qualifier or the Date Format is set to Abbreviated (3), and the Preferred Short Date Format is set to yyyy-mm-dd, then the ISO Date Format is produced with leading zeros where necessary.
That is all handled in the Plugin script where the Date functions are derived from the English (ENG) Calico Pie Language Pack and modified to handle extra format options:
On Line 14:
require "luacom";
About Line 55:
g_date_stand_form = "ddmmmyyyy";
g_date_short_form = "dd/mm/yyyy";
g_date_short_sep = "/"
Changes and additions:
function FH_LangPackBegin(...)
function GetRegKey(strKey)
function GetDatePtText(...)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Does not display date in ABBREV3 format
Mike;
In order to get FH to use a format like "27 Feb 2024", is doing a language pack modification the route to go?
In order to get FH to use a format like "27 Feb 2024", is doing a language pack modification the route to go?
Gary Gauthier
Hunting History in the Wild!
Hunting History in the Wild!
- tatewise
- Megastar
- Posts: 28488
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Does not display date in ABBREV3 format
No Gary, you can set the Date Format in the Diagram Text Scheme options.
See the Diagram > Options > Text tab, Edit Text Scheme... button, Date Format: option near the top.
Some options depend on Tools > Preferences > General tab Preferred Standard/Short Date Format settings.
See the FH Help on General Topics > Date Formats for details.
This thread is discussing the intricacies of translating Date Formats with Language Packs but if everything is in English they do not apply.
BTW: The default Text Scheme setting is Date Format: Compact which produces 27 Feb 2024 as in your question.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Does not display date in ABBREV3 format
Thank you, Mike. I saw your other answer and will try that.
Gary Gauthier
Hunting History in the Wild!
Hunting History in the Wild!