Hierarchy: Print Time Functions

From Dreamwidth Notes
Revision as of 06:47, 8 May 2009 by Seperis (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Add notes here.

Purpose

In the Beginning

Function: print_time

class Entrylite

Functions

function print_time () [fixed];
Print the time of this post, with most useful information for user, and with tooltip for more.
function print_time (string datefmt, string timefmt) [fixed];

Print the time of the post, with customized date/time formats.

Stucture

function EntryLite::print_time() 
{
    print $this->time_display();
}


function EntryLite::time_display() : string 
{
    return $this->time_display("", "");
}
  1. Let the real function decide on some nice defaults


function EntryLite::time_display(string datefmt, string timefmt) : string 
{
    if ($datefmt == "") {$datefmt = "med";}
    if ($timefmt == "") {$timefmt = "short";}
 
    var string ret;
    if ($datefmt != "none") { $ret = $ret + $this.time->date_format($datefmt); }
    if ($datefmt != "none" and $timefmt != "none") { $ret = $ret + " "; }
    if ($timefmt != "none") { $ret = $ret + $this.time->time_format($timefmt); }
    return $ret;
}
function builtin date_format () : string;
Returns date formatted as normal. /// SeeAlso: siteapi.core1.dateformats"
function builtin date_format (string fmt) : string;
Returns date formatted as indicated by \$fmt. One of: short, med, long, med_day, long_day. Or a custom format. Default is 'short'. /// SeeAlso: siteapi.core1.dateformats
function builtin date_format (string fmt, bool linkify) : string;
Returns date formatted in the same way as calling date_format(string fmt), but with day, month, and year as links to the corresponding archive pages.
function builtin time_format () : string;
Returns time formatted as normal. /// SeeAlso: siteapi.core1.dateformats
function builtin time_format (string fmt) : string;
Returns time formatted as indicated by \$fmt, or normal if blank. /// SeeAlso: siteapi.core1.dateformats




class Comment

class Page

Associated Properties