Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-08-09 15:04:08

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

[RFC] Calendars support?

The (likely) deprecation of strftime() function in PHP 8.1 makes us search for a replacement. The natural date() candidate does not support non-English languages. We are currently testing IntlDateFormatter class that looks promising. As a by-product, introducing non-Gregorian calendars seems possible, though requires some work. Is it worth doing? Please comment.

Meanwhile, if you can test 4.8.8 for various date-related features, it would be ace. Thanks!

Offline

#2 2021-08-10 03:15:12

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,474
Website

Re: [RFC] Calendars support?

etc wrote #331249:

Meanwhile, if you can test 4.8.8 for various date-related features, it would be ace. Thanks!

At first sight and very very basic look, things look alright in my 4.8-dev playground. Not everything you have landed there has been added to the 4.9-dev codebase, right ? (as mentioned before, that playground has much more “things” ready to use or verify). BTW thanks to adding UTC as a time zone.

Regarding those other calendars, that would certainly a nice addition. Probably a less urgent task. The Persian calendar, or dates based on the Japanese Imperial era names, or the more ancient Chinese era names. The latter ones is more of interest for history oriented sites. The Japanese era naming/dating is actively used, e.g. in administrative documents. One can dream a little…


Where is that emoji for a solar powered submarine when you need it ?

Offline

#3 2021-08-10 08:19:40

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

Re: [RFC] Calendars support?

etc wrote #331249:

Meanwhile, if you can test 4.8.8 for various date-related features, it would be ace. Thanks!

I keep coming back to the idea that us doing a 4.8.8 beta (with appropriate fanfare) might be a smart idea. I know it’s new territory for a patch release, but then we’ve never been especially rigid in only putting patches into patch releases, so…

Offline

#4 2021-08-10 08:25:25

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,474
Website

Re: [RFC] Calendars support?

gaekwad wrote #331256:

I keep coming back to the idea that us doing a 4.8.8 beta

Given how there are some fairly serious changes for PHP 8.1 compatibility, it is probably a good idea…


Where is that emoji for a solar powered submarine when you need it ?

Offline

#5 2021-08-10 08:47:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,520
Website GitHub

Re: [RFC] Calendars support?

If it’s not too much hassle, then I think different calendars would be a real boon. Kjeld would love us :)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2021-08-10 09:25:29

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: [RFC] Calendars support?

Bloke wrote #331258:

If it’s not too much hassle…

It is, with or without calendars. Realistically, in 4.8.8 we could add calendar attribute to date tags (e.g. <txp:posted calendar="persian" />), but keep dates input Gregorian atm. If there is a real need for other calendars dates input, we could see later.

Offline

#7 2021-08-10 09:56:31

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

Re: [RFC] Calendars support?

etc wrote #331259:

It is, with or without calendars.

Forgive me…it is not too much hassle, or it is too much hassle – I’m easily confused.

Offline

#8 2021-08-10 10:07:43

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

Re: [RFC] Calendars support?

etc wrote #331259:

Realistically, in 4.8.8 we could add calendar attribute to date tags (e.g. <txp:posted calendar="persian" />), but keep dates input Gregorian atm. If there is a real need for other calendars dates input, we could see later.

+1. This seems eminently reasonable. Is there a standard (ISO?) for the various calendar names? I’m looking at the moment, but nothing has turned up yet.

Offline

#9 2021-08-10 10:17:08

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: [RFC] Calendars support?

gaekwad wrote #331261:

+1. This seems eminently reasonable. Is there a standard (ISO?) for the various calendar names? I’m looking at the moment, but nothing has turned up yet.

Here we go.

Offline

#10 2021-08-10 10:26:04

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,474
Website

Re: [RFC] Calendars support?

etc wrote #331262:

Here we go.

Or the more recent version, here

(I think we were both looking for the same at the same time, you were faster in posting…)


Where is that emoji for a solar powered submarine when you need it ?

Offline

#11 2021-08-10 10:32:01

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

Re: [RFC] Calendars support?

Offline

#12 2021-08-10 10:33:41

etc
Developer
Registered: 2010-11-11
Posts: 4,517
Website GitHub

Re: [RFC] Calendars support?

phiw13 wrote #331263:

I think we were both looking for the same at the same time, you were faster in posting…

:-) I’ve spent already few days on it… a real nightmare all these codes conversion.

Offline

Board footer

Powered by FluxBB