[TYPO3-dev] ADOdb extended dates prototype

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue May 22 17:49:52 CEST 2007


Christoph Koehler wrote: on 21.05.2007 23:26:

> Here is my idea. To be consistent with the approach that would work for
> extensions and server side dates, namely ADOdb time, I believe it needs
> to be used when entering dates, too. Client side would be faster, but
> ultimately there could be problems with early dates due to the switch to
> the Gregorian calendar and maybe others.

I think we always will have some problems in that area, as the gregorian
date switch depends also on local adoption (1582 in christian countries,
but for example 1927 in turkey). So you would need to know in which
country the date refers to if you want to be precise.

> My proposal is this: The reason it's so slow is the inclusion of
> init.php. I can work around that and make it fast. Benchmarks showed
> that requests without including init.php were about 200ms for the first,
> and 20ms for subsequent requests, which is very reasonable compared to
> over 1000ms it takes now for each request.

Ok with me, I just think that this overhead is not needed as JavaScript
already has a pretty robust Date() object to make client side calculations.

> My solution would also take care of timezones in that it would be
> converted to GMT during transmit and back to server time before saving,
> similar to the patch you linked to, if I understand correctly.

If you convert them to UTC anyway, why do you need to contact the server
for getting a timestamp? Just to be sure you handle the gregorian switch
correctly?

> I would take the timezone from the client, getting rid of the config field,
> while at the same time keeping the possibility to configure your own
> desired date format for date entry and output in all the forms,
> consistently. That has been a complaint I have heard before from clients
> and it really doesn't add any problems.

True.

> That would mean your patch will not be needed. I heard you guys thought
> it through very thoroughly, so I want to be sure I get everything right.
> By the time you read this I probably have a new version of extdates
> already released for you guys to consider, I just wanted to post this
> anyway.

Sounds cool, lets keep it rolling. I think this is a matter that we
always have in debate but nothing really ever changed since. So having
some test code and experience with that might enlighten us a bit more
and point towards the correct direction.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list