Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2021-08-10 10:35:58

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,215
GitHub

Re: [RFC] Calendars support?

Is there anything helpful we can glean from core.trac.wordpress.org/changeset/51587 ?

Offline

#14 2021-08-10 10:38:03

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: [RFC] Calendars support?

@gaekwad btw, is 4.8.8 demo Back Soon?

Offline

#15 2021-08-10 10:39:17

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,215
GitHub

Re: [RFC] Calendars support?

etc wrote #331267:

@gaekwad btw, is 4.8.8 demo Back Soon?

I had no idea it was down – will investigate now.

Offline

#16 2021-08-10 10:42:18

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,215
GitHub

Re: [RFC] Calendars support?

etc wrote #331267:

@gaekwad btw, is 4.8.8 demo Back Soon?

Now fixed. Apologies for the downtime.

Offline

#17 2021-08-10 10:44:44

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: [RFC] Calendars support?

gaekwad wrote #331266:

Is there anything helpful we can glean from core.trac.wordpress.org/changeset/51587 ?

Nope, we are in advance.

Offline

#18 2021-08-10 20:47:38

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: [RFC] Calendars support?

Bloke wrote #331258:

Kjeld would love us :)

Love is in the air (provided php intl extension is enabled):

<txp:posted calendar="japanese" format="%c" />

Offline

#19 2021-08-10 23:12:00

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,138
Website

Re: [RFC] Calendars support?

etc wrote #331275:

Love is in the air (provided php intl extension is enabled):

<txp:posted calendar="japanese" format="%c" />…

that sounds … lovely :-)

p.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#20 2021-08-11 06:20:01

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,138
Website

Re: [RFC] Calendars support?

An issue with localised date (Japanese).

In the following, the date (<txp:posted />) for the article is September 5, 2020, date output based on the selected format in Preferences when not overridden. The spaces between Y/M/D in the manual examples are added for readability here in the forum.

–^–^–

I am not sure if this an error on my side or a weakness somewhere (Textpattern? PHP?).

Input: <txp:posted />, output: 5 September 2020.

Localised – Input: <txp:posted lang="jpn" />, output 5 9月 20. Expected: 5日 9月 20. PHP (or Textpattern ?) automagically adds the (month) but not (day).

If I manually build the date, with format='%Y %b %e', output is 2020 9月 5 . Again, expected 5日.

Then, adding the calendar attribute, short form:
Input:<txp:posted calendar=‘japanese’ format=’%x’ lang=‘jpn’ />, output: R2/9/5. Technically this is correct, 2020 is equivalent to Reiwa 2 (current era name). However “Reiwa” could be localised (令和). If I use the longer form, same <txp:posted /> as above, with addition of the calendar attribute, I get 2 9月 5, no era indication.

The same problem happens with the public side set to use Japanese.

The missing character is certainly not new. That happens with previous versions Textpattern as well. It shouldn’t be very difficult for me to manually add the era name in my long-form examples, or the “day” character. The latter I have done in the past.

Note1: Japanese date notation: Wikipedia note
Note2: I think the new date() code has one other improvement, when the admin side is set to Japanese, the date selectors display the month (August at time of writing) as 8月, previously this was not translated. That is great.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#21 2021-08-11 06:35:22

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,138
Website

Re: [RFC] Calendars support?

PS – The calendar attribute works well otherwise, i tried backdating articles to the Heisei era (8 January 1989 – 30 April 2019) and Showa era (December 25, 1926 – January 7, 1989). I did not try earlier.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#22 2021-08-11 08:31:00

etc
Developer
Registered: 2010-11-11
Posts: 5,132
Website GitHub

Re: [RFC] Calendars support?

@phiw13 thanks for testing, Philippe. Default (%c, %x and %X) date formats are delegated to PHP. Currently they are set to SHORT form, we can switch them to LONG if necessary. I’ve kept the other txp %_ formats intact, but they do not support well Oriental languages. Will see if we can fine-tune them. Leave me few hours minutes and it will be possible to use ICU formats too, just don’t mix both.

I also think that the default list of txp formats should be reduced in favour of custom ones.

Offline

#23 2021-08-11 08:49:13

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,138
Website

Re: [RFC] Calendars support?

etc wrote #331287:

@phiw13 thanks for testing, Philippe. Default (%c, %x and %X) date formats are delegated to PHP. Currently they are set to SHORT form, we can switch them to LONG if necessary. I’ve kept the other txp %_ formats intact, but they do not support well Oriental languages. Will see if we can fine-tune them. Leave me few hours and it will be possible to use ICU formats too, just don’t mix both.

Thanks for taking the time to investigate further! If it is PHP doing most of the lifting, then OK. As I said, given what we have now, it is possible to build the dates in a variety of formats, long and short. A bit of manual tweaking, but OK.

I also think that the default list of txp formats should be reduced in favour of custom ones.

+1 on that one. That would simplify the UI and remove some ambiguity.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#24 2021-08-11 10:45:15

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,215
GitHub

Re: [RFC] Calendars support?

etc wrote #331275:

(provided php intl extension is enabled)

Now added as a recommended module in Textpattern system requirements

Offline

Board footer

Powered by FluxBB