URL:
<http://gna.org/task/?func=detailitem&item_id=2614>
Summary: Support different calendar systems
Project: Savane
Submitted by: toddy
Submitted on: Fri 11/18/2005 at 02:49
Should Start On: Fri 11/18/2005 at 00:00
Should be Finished on: Sun 12/18/2005 at 00:00
Category: Web Frontend
Priority: 1 - Later
Status: None
Privacy: Public
Assigned to: toddy
Open/Closed: Open
Planned Release:
For/By: Gna!
_______________________________________________________
Details:
Based on the discussion in bug #4570, I think it's probably a good idea to
make Savane agnostic about the calendar which is being used.
This could also help to solve bug #2198 and bug #4542.
I propose in the first step to use format_date() everywhere in the code and
remove all direct calls to strftime (there are only four in the entire code
base).
Second, the call to format_date() should be modified. Currently,
format_date() takes as the first parameter the format to be used. In almost
all calls, this is set to $sys_datefmt, which is kind of pointless.
Instead of specifying a format parseable by strftime, we could specify a
human readable string with the (meta-)format to be shown.
Examples:
format_date($date, "long");
=> Fri, 18 November 2005 02:33
format_date($date, "short");
=> 18 November 2005
format_date($date, "ultrashort");
=> Nov 2005
format_date($date, "relative");
=> today
The function could then be extended to support different calendars quite
easily, just add a third parameter:
format_date($date, "long", "jalali");
=> 27 Aban 1384 02:33 (Warning: this is just guessing ...)
What do you think?
_______________________________________________________
Reply to this item at:
<http://gna.org/task/?func=detailitem&item_id=2614>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Savane-dev mailing list
[email protected]
https://mail.gna.org/listinfo/savane-dev