Monday 21 November, vers 20h, Tobias Toedter écrivit : > > Hi, > > there are a couple of things I wanted to discuss without further > bloating task #2614. These are only coding issues, that's why I > didn't post it to the tracker but on our development mailing list. > > 1. The inverted parameters in format_date() and utils_format_date() > are a sure way to mess things up sometime. I would strongly suggest > to uniform the calls; I can do the necessary conversions in the > code.
That would sounds good but I'd like such thing to be delayed after 1.3 release. > 2. The parameter $default_value is not used anywhere in the code, > that's why I didn't implement it in the function. We should probably > drop it until we really need it. If the timestamp is null, we can > just return "-". I thought it was used in rare occasion when date information was missing (typically, on very old item that were older than the fusion of the tracker code: the previous task tracker did not stored many date information as the current one does, as result old items got missing dates). But if a grep shows no more calls of it, sure we can remove it. > 3. Do we really need utils_format_date() and format_date()? If the > first function name is too long, we can just drop it and use > format_date(). I wanted to reduce the code bloat, which is already > quite big. So why do we provide an alias for this function, when the > alias function is not used anywhere in our code? I think important to keep a clear policy to name functions, and that involve have function name beginning with the file they are in. But I recognize the need to have, for a few functions, shortcuts, aliases, because otherwise the code would be twice longer (and as such hard to read). > 5. I think we should drop $sys_datefmt from the configuration > options and hence from the global variables. It's recommended anyway > to comment this option out, and the PHP frontend has more than just > one format (namely default, short, minimal) to display a date. Thus, > it's not enough to control how dates are displayed. No no, we cannot remove it. It is used on several installation that use no localization at all and want to push a unique kind of date format. If installation want this, we must keep it for them, even if it is a not a recommended usage. And if it display dates in a stupid fashion, it is their problem, not ours, we did our part the best we could. -- Mathieu Roy +---------------------------------------------------------------------+ | General Homepage: http://yeupou.coleumes.org/ | | Computing Homepage: http://alberich.coleumes.org/ | | Not a native english speaker: | | http://stock.coleumes.org/doc.php?i=/misc-files/flawed-english | +---------------------------------------------------------------------+
