Skrol29 / opentbs

With OpenTBS you can merge OpenOffice - LibreOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use OpenOffice - LibreOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats. That is the Natural Template philosophy.
http://www.tinybutstrong.com/opentbs.php
70 stars 17 forks source link

The argument locale is ignored when merging a date #15

Open guiyo1 opened 3 years ago

guiyo1 commented 3 years ago

Hello,

We noticed a bug in the merging of dates in the latest version of opentbs.

We are using the following to merge a date :

[datetime.date;frm=dddd dd mmmm yyyy;locale]

Which is replaced with opentbs 1.9.11 by : lundi 07 juin 2021

(We also have set the locale with a call to setlocale(LC_TIME, "fr_FR.utf8");)

But in the latest version of opentbs (1.10.2), we have the following :

Monday 07 June 2021

The locale seems to be ignored. We had to rollback to the version 1.9.11

roxblnfk commented 3 years ago

I think this behavior depends on Skrol29/tinybutstrong package

Skrol29 commented 3 years ago

It depends of the TinyButStrong version running the OpenTBS plug-in.

Try this:

Template :

[datetime.date;frm=dddd dd mmmm yyyy(locale)]

See the keyword (locale) that replaces the parameter locale.

PHP : setlocale(LC_TIME, "fra"); // "fr_FR.utf8" did not work on my computer

guiyo1 commented 3 years ago

Sorry if I used the wrong repo, I didn't know which one would fit best.

We were using tinybutstrong 3.11 with opentbs 1.9.11, and we upgraded to tinybutstrong 3.12.2 with opentbs 1.10.2

I can confirm that it does indeed work with the keyword (locale).

Is there any documentation on the change of this behavior ? I didn't find any mention in the changelog of both tinybutsrong and opentbs.