Default date format, “format” parameter and custom_date variable
Posted: 07 September 2008 02:01 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  284
Joined  02-02-2007

Hi,

I have 3 points concerning date variables.

1. It would be handy to have a possibility to set default date format in Control
Panel. Currently “format” parameter is required for all date variables. This parameter
can be made optional and used in cases when there is a need to override default
date format. This would save us some typing when using date variables and would allow
to change easily format of date variables already used in templates.

2. “Format” parameter as currently used fulfills two functions:
a) specifies WHAT should be displayed by date variable (e.g. year, month and day)
b) specifies HOW date items should be displayed (e.g YYYYMMDD)

In order to be possible to set default date format in Control Panel which could
accommodate all possible dates those two functions should be separated. That can
be achieved by introducing a new parameter; let’s call it “show_what”.
In case default date format was specified in Control Panel, “show_what” parameter
would allow to write date variables as in this code example:

{current_date show_what="Y|M|D|H"}

3. It would be handy to have “custom_date” variable which would output the date
which is entered as a value of “time” parameter formatted according to
default date format. An example of code:

{custom_date time="2008:09:12::22:51"}

This variable would be useful in cases there is a need to output dates of some
standard events. Examples of such standard events can be a web page wchich
displays a calendar of some events or a blog post having several updates. In
the last example the code would be as follows:

<p>UPDATE {custom_date time="2008:08:15::22:51"} Lorem ipsum minimum vulputate
ullamcorper no mea
, veniam invidunt mel ei, in pro laudem accommodare. His an
adhuc pericula
, in mediocrem definitionem per. Pri eu legendos accommodare,
est ei graecis honestatis. Usu ei adipisci erroribus, ei ludus tollit utroque
sea
, postulant scripserit id eos. Eum ea maiorum invenire mediocrem. Brute
mollis nec ea
.</p>

<
p>UPDATE {custom_date time="2008:09:01::15:20"} Illud mazim te pri. An malis
euismod vis
, usu ei quod populo dissentiet, ceteros expetenda mel ei. Ex
prompta quaerendum eloquentiam duo
. No admodum apeirian reprimique mei.</p>

<
p>UPDATE {custom_date time="2008:09:12::10:15"} Eu lorem timeam vix, dicta
detracto complectitur ut sed
. Eirmod periculis his no, vide efficiantur no
nam
. Sea ex congue doming fastidii, ullum mediocritatem necessitatibus vel at.
Ei ludus sanctus duo, nisl disputando duo et, duo ad facer soleat aperiam. Sed
habeo feugait suavitate ad
, no sit amet labitur sanctus.</p>

 Signature 

Full list of plugins here

Child Categories
Browser Sniff
Category Id
Entries List

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 31
Total Topics: 81863 Total Anonymous Users: 17
Total Replies: 440097 Total Guests: 174
Total Posts: 521960    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb