Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [RFC] Calendars support?
Is there anything helpful we can glean from core.trac.wordpress.org/changeset/51587 ?
Offline
Offline
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
Re: [RFC] Calendars support?
Offline
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
Re: [RFC] Calendars support?
Bloke wrote #331258:
Love is in the air (provided php intl
extension is enabled):
<txp:posted calendar="japanese" format="%c" />
Offline
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
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
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
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
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 toSHORT
form, we can switch them toLONG
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
Re: [RFC] Calendars support?
etc wrote #331275:
(provided php
intl
extension is enabled)
Now added as a recommended module in Textpattern system requirements
Offline