xoops forums

jjdai

Just popping in
Posted on: 2012/2/22 20:18
jjdai
jjdai (Show more)
Just popping in
Posts: 21
Since: 2006/6/17
#1

Xoopd 2.5.5 - Gestion des dates

Bonjour
-------------
I am testing 2.5.5 and of course i look at the date in french.

With
define("_CAL_FORMAT","Y-m-d");
No problem but it is not french format

but with (french format)
define("_CAL_FORMAT","d-m-Y");
or
define("_CAL_FORMAT","d/m/Y");
The date is in bad format.

I think that the probleme is not resolved because, it is the module that must transform the date the good format, or it's a good way.

I think that the real solution is that the module send a timestamp unix to the class xoopsformcalendar, the calendar show date as langue and it send a timstamp to the module wiche save it in mysql.
(timestamp or universal date)

In the good way i think the processus mus be like this:
Mysql --> format date or datetime (2012-02-10 21:09:08)
module send to calendar ---> format date or datetime (2012-02-10 21:09:08)
calendar show date in format of land (french 10-02-2012 jj-mm-YYYY)
Change the date ---> (exemple : 25-01-2012 21:09:08)
When form is validate
calendar must send to the module --->Mysql format (2012-01-25 21:09:08)
module save as mysql format (2012-01-25 21:09:08) independant of language


May be, to keep compatibility, the best is to pass by a new calendar in this way.

I hpope that i am explicit.

For the rest i have not again notice any problème, but i continue my tests
JJdai


ForMusS

Core Developer
Posted on: 2012/2/22 20:39
ForMusS
ForMusS (Show more)
Core Developer
Posts: 146
Since: 2007/10/19
#2

Re: Xoopd 2.5.5 - Gestion des dates

Hello,

The main problem was that some module use the old date format for split and check if the date is ok and have a correct format.
So they check Y-m-d and wait for a date like 2012-02-22 and return an error (see extcal)
This problem is not a core error, but a module error and can't be fixed by core change.
I have include a CAL_FORMAT for adapt date in each site.
Actually, date is set to Y-m-d for a legacy use, like old version (eg. all old version use only this date format), but if a site use a fresh module that don't check the date and use the simple way for save it, you can use an other format d/m/Y or an other.
Any other way, broke old module, and if we include an easy way for date, we must do it in 2.6.

Nicolas

jjdai

Just popping in
Posted on: 2012/2/22 21:15
jjdai
jjdai (Show more)
Just popping in
Posts: 21
Since: 2006/6/17
#3

Re: Xoopd 2.5.5 - Gestion des dates

ok
JJDai