- Posts: 2165
Question Date/time format options
- WGroleau
- Topic Author
- Offline
- Platinum Member
Less
More
14 years 3 months ago #1
by WGroleau
--
Wes Groleau
UniGen.us/
Date/time format options was created by WGroleau
I would rather use the more widely accepted 29 Aug 2010 format throughout without having to select a language other than U.S. English.
--
Wes Groleau
UniGen.us/
Please Log in or Create an account to join the conversation.
- fisharebest
- Away
- Administrator
14 years 3 months ago #2
by fisharebest
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Replied by fisharebest on topic Re:Date/time format options
The date format is stored in the language files.
At the moment, the en_US.mo file contains just one translation - to translate "%j %F %Y" into "%F %j, %Y". Future versions may include US specific terms (Zip Code instead of Postal Code) or US-specific idioms ("Under the hood").
Due to restrictions in the way launchpad translations work, we cannot store en_US translations online, so en_US.po is maintained offline.
I've attached a modified version (with this translation removed), and a compiled version in a .ZIP file.
Simply replace language/en_US.mo with the new version
At the moment, the en_US.mo file contains just one translation - to translate "%j %F %Y" into "%F %j, %Y". Future versions may include US specific terms (Zip Code instead of Postal Code) or US-specific idioms ("Under the hood").
Due to restrictions in the way launchpad translations work, we cannot store en_US translations online, so en_US.po is maintained offline.
I've attached a modified version (with this translation removed), and a compiled version in a .ZIP file.
Simply replace language/en_US.mo with the new version
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- lexoulu
- Offline
- New Member
14 years 3 months ago #3
by lexoulu
openSUSE 12.1, Apache 2.2, PHP 5.3, MySQL 5.5
Replied by lexoulu on topic Re:Date/time format options
I am not sure if this is off-topic, but the topic title seems suitable.
The majority of my users have the tendency to type dates, into the date fields, as they typically would do. This means typing 31.1.1901 or 31.01.1901 or xx.xx.01 or (FIN) 31 tammikuu 1901 / (SWE) 31 januari 1901. Very much the way Microsoft gives the localised region settings in their programs.
This is a hassle for an admin to correct these mistakes. webtrees is very forgiving in acccepting strange date entries, so in the above example only 1901 is shown in the date field, leaving viewers (&admin) blind to the "error" inside.
Ideal, would be to have a region system as Microsoft has, but fair enough, it is a question a of who has the free-time / energy to build something like that into webtrees.
The current option is to provide a pop-up window for the user to enter the information. However, in my experience my users just don't seem to "get the idea". Fair enough, why should they remember to do it one way elsewhere (as most programs do) and remember to do it differently in webtrees.
Would it be feasible to use reversed the logic. Default is the pop-up date entry window, and alternative "enter it yourself?
or
Warning next to the field, that more data is in the field than shown? Ideal would be to give a warning to admins :
The majority of my users have the tendency to type dates, into the date fields, as they typically would do. This means typing 31.1.1901 or 31.01.1901 or xx.xx.01 or (FIN) 31 tammikuu 1901 / (SWE) 31 januari 1901. Very much the way Microsoft gives the localised region settings in their programs.
This is a hassle for an admin to correct these mistakes. webtrees is very forgiving in acccepting strange date entries, so in the above example only 1901 is shown in the date field, leaving viewers (&admin) blind to the "error" inside.
Ideal, would be to have a region system as Microsoft has, but fair enough, it is a question a of who has the free-time / energy to build something like that into webtrees.
The current option is to provide a pop-up window for the user to enter the information. However, in my experience my users just don't seem to "get the idea". Fair enough, why should they remember to do it one way elsewhere (as most programs do) and remember to do it differently in webtrees.
Would it be feasible to use reversed the logic. Default is the pop-up date entry window, and alternative "enter it yourself?
or
Warning next to the field, that more data is in the field than shown? Ideal would be to give a warning to admins :
openSUSE 12.1, Apache 2.2, PHP 5.3, MySQL 5.5
Please Log in or Create an account to join the conversation.
- fisharebest
- Away
- Administrator
14 years 3 months ago #4
by fisharebest
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Replied by fisharebest on topic Re:Date/time format options
There was once an attempt to do this, but it was written in PHP, which meant it ran *after* the user hit SAVE. It also failed whenever anyone used a month name with declensions.
We could possibly use something like this in javascript. It should be pretty easy. Now that we have all the months with their declensions and abbreviations, it should be possible to do a simple translation into gedcom "english month abbreviations".
Just like when you type "1900-1905" and it changes automatically to "BET 1900 AND 1905"
There are a number of things to watch out. For example, in German, you cannot just convert "Juli" to "JUL", as it breaks "@#DJULIAN@" dates.
How's your javascript? You could look at valid_date() in js/webtrees.js to see how the current "fixes" work.
This new function would need to be generated dynamically on the edit_interface page, as it needs to use the current language to drive the conversions.
We could possibly use something like this in javascript. It should be pretty easy. Now that we have all the months with their declensions and abbreviations, it should be possible to do a simple translation into gedcom "english month abbreviations".
Just like when you type "1900-1905" and it changes automatically to "BET 1900 AND 1905"
There are a number of things to watch out. For example, in German, you cannot just convert "Juli" to "JUL", as it breaks "@#DJULIAN@" dates.
How's your javascript? You could look at valid_date() in js/webtrees.js to see how the current "fixes" work.
This new function would need to be generated dynamically on the edit_interface page, as it needs to use the current language to drive the conversions.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- fisharebest
- Away
- Administrator
14 years 3 months ago #5
by fisharebest
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Replied by fisharebest on topic Re:Date/time format options
.... or maybe the code could be added to the valid_date() function, but which uses month translation data which is set in edit_interface. This would keep the logic together.
See the init_calendar_popup() function for how we do a similar thing elsewhere......
See the init_calendar_popup() function for how we do a similar thing elsewhere......
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- lexoulu
- Offline
- New Member
14 years 3 months ago #6
by lexoulu
openSUSE 12.1, Apache 2.2, PHP 5.3, MySQL 5.5
Replied by lexoulu on topic Re:Date/time format options
Thanks for the hints on what to look for.
I'll have a look.
I'll have a look.
openSUSE 12.1, Apache 2.2, PHP 5.3, MySQL 5.5
Please Log in or Create an account to join the conversation.