Idea
Add Day to Event Dates
- RickM
-
Topic Author
- Offline
- Junior Member
-
In some parts of WEBTREES the dates shows a day as well eg; in the News and Changes Modules day and date AND Time are shown 'Sunday, 8 December 2024 10:24 AM'.
Would it be possible and wanted to have the OPTION to show actual day of the event eg Birth date Wed, 6 Dec 1905 or Wednesday, 6 December 1905
I don't think the actual code to do this would be hard BUT me doing it would be..
Appreciate peoples thoughts before I add to Github wants list!!
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- Bernat
-
- Away
- Junior Member
-
www.quiesquiacalp.es
webtrees 2.2.
Servidor MySQL 8.0.36
Servidor web: nginx/1.18.0
Versión PHP 8.3.3.
Hosting a webtrees.net
Please Log in or Create an account to join the conversation.
- bertkoor
-
- Away
- Platinum Member
-
- Greetings from Utrecht, Holland
stamboom.BertKoor.nl runs on webtrees v2.1.20
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
As an example, here are the translations for en-US.
This gives time in the 12 hour clock and for dates in the Month Day, Year format
Adding weekday is a simple matter of adding either %D (short weekday) or %l (long weekday).
The example module shows how to add custom translations.
Simple copy/paste the example module, delete all the bits you don't need and add translations as required.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- TheDutchJewel
-
- Offline
- Junior Member
-
Appreciate peoples thoughts before I add to Github wants list!!
I made the change and find it a very informative addition. So thanks for the request, and Bert and Greg thanks for the solution!
But I see that the weekdays start with a capital letter everywhere. Especially in reports (in a running sentence) this is disturbing, so I added in the translation module also the weekdays to start with a lowercase letter:
• webtrees 2.0.19 (last 2.0.x version that Vesta fixed for changed markdown implementation)
+ Laragon 8 with PHP 7.4.33 + Rural & Primer theme + Vesta & other modules
• latest webtrees 2.2.x (only for testing and presentation) + PHP 8.4.x
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
Perhaps the translation for Dutch ought to be changed to lower-case?
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- TheDutchJewel
-
- Offline
- Junior Member
-
As far as I can see, weekdays in webtrees can just be used with a lowercase letter, including the abbreviations.
I have adjusted the translation accordingly so that the translation module is no longer needed for this.
Thanks for the tip!
• webtrees 2.0.19 (last 2.0.x version that Vesta fixed for changed markdown implementation)
+ Laragon 8 with PHP 7.4.33 + Rural & Primer theme + Vesta & other modules
• latest webtrees 2.2.x (only for testing and presentation) + PHP 8.4.x
Please Log in or Create an account to join the conversation.
- RickM
-
Topic Author
- Offline
- Junior Member
-
Ok Module Done.. Really simple thanks for the suggestions..
As I have added the Day I think it might be good if I can add the Ordinal Indicator (date Suffix eg th, st, rd, nd). I have tried %S and just S directly after the %j but that just shows Sunday, 17 %S January 1886
I'm guessing there is another part I have to sort out.. any pointers please!
Really appreciate the support and backup from everyone..
WebTrees Rocks!!
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- RickM
-
Topic Author
- Offline
- Junior Member
-
I have attached my rendition of changed the date structure to show Actual Day for Date. If I read the date formatting examples correctly I should be able to add Ordinals as previously indicated by including S after %j as in the file dayfordate.php
The addition of %l works %jS does NOT..
What am I missing????
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- RickM
-
Topic Author
- Offline
- Junior Member
-
Appreciate you coming back to me..
However I must have something NOT right.. <Smile>
%S not work for me..
What files should I look at to test this with when seen in the likes of the News module, Changes in last xx days module, as these show day date and time already
Cheers
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
github.com/fisharebest/webtrees/blob/b65...arDate.php#L507-L565
Probably because it is very language-dependent, and cannot easily be translated. I would to know the rules for every language that we support.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- kiwi
-
- Offline
- Platinum Member
-
Something else to consider. If you use full length day, and full length months, then in some cases (a great many in my trees), you can end up with dates like this:
"between Monday, 1 October, 1951 and Monday, 31 December, 1951"
Also, even single dates can be too long if, say, displayed on a phone.
Perhaps "between Mon, 1 Oct, 1951 and Mon, 31 Dec, 1951" would be more practical?
Nigel
www.our-families.info
Please Log in or Create an account to join the conversation.
- RickM
-
Topic Author
- Offline
- Junior Member
-
I did notice this for a few of my dates etc when having 'between' involved..
I think it is really a personal preference how to display dates.. And even then in some places AND device screen sizes it would be rather nice to be able to have a method of switching them. And I will have to think a bit more on the right display method for me!! I get a bit pedantic about some stuff for sure.. <SMILE>
Greg makes a valid point and shows willing to look at something if he can find all the right rules for the various languages and such. I will have a little bit more of a look at the abstractcalendardate file..
If it helps any at all I have set the 'Gregorian' Date with no conversion..
Thanks for the help and input All.. Somewhere will be the right answer.. ?Just WHERE?' is the right question me thinks <SMILE>
Rick M
Tauranga
Nu Tirani - New Zealand
alineofmalkins.com/wt-malkins
Webtrees v2.2.1
Hosted by HostAmarada on litespeed Server, PHP v8.3
Offline: WebTrees v2.2.2-dev
Laragon v6, PHP v8.3.15
Please Log in or Create an account to join the conversation.