🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #148667

[Dialog] New version of the Date column formatting script

#148667
From: Antonio 'Gandalf' Favata
Date: Sat, 22 May 2004 05:14
48 lines
2682 bytes
New! Now even more customizable! :)

program OnArticleListPaint;

const
 
 colDate  = 3; //count your columns from left to right starting from 0
               //and write here the number of the column with the date

 dateFmt  = 'dd/mm';    // refer to dialog.chm::/date_timeformatstrings.htm
 timeFmt  = 'hh:mm';    // refer to dialog.chm::/date_timeformatstrings.htm
 todayStr = '(oggi)';   // "today" in your language and with your favourite formatting
 invert   = true;       // set this to false if you don't want to invert date and time
 
function OnArticleListPaint(PaintString:widestring; ColumnIndex:integer):widestring;
                                                             
var
    fmt : String;  

begin

if ColumnIndex = colDate then
    begin
         if DateToStr(StrToDateTime(PaintString)) = DateToStr(Now) then
            fmt := '"'+todayStr+'"'
         else
            fmt := dateFmt;
         
         if invert then
            fmt := timeFmt + ' ' + fmt
         else
            fmt := fmt + ' ' + timeFmt;

         PaintString := FormatDateTime(fmt, StrToDateTime(PaintString));
    end;

result := PaintString;
end;

begin
end.

Feel free to use and/or put in Wiki [the older version is already there]
-- 
Fare Well!      FIAG member | Free mail & news | 40tude Dialog v2.0.12.1
G               www.fiag.it | www.x-planet.org | http://snurl.com/dialog

Mozilla (Suite, Firefox, Thunderbird): news:it-alt.comp.software.mozilla
Technical Details
Message-ID: <1m26xcvqu315b$.dlg@gandalf.my-fqdn.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!peernews3.colt.net!newsfeed.stueberl.de!ecngs!feeder.ecngs.de!x-privat.net!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <1m26xcvqu315b$.dlg@gandalf.my-fqdn.de>
Subject: [Dialog] New version of the Date column formatting script
Date: Sat, 22 May 2004 07:14:58 +0200
From: Antonio 'Gandalf' Favata <gandalf@ithn.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!internal1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!peernews3.colt.net!newsfeed.stueberl.de!ecngs!feeder.ecngs.de!x-privat.net!not-for-mail
Newsgroups: news.software.readers
User-Agent: 40tude_Dialog/2.0.12.1it (8be5dd28.428.31) Hamster-Pg/1.15
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Reply-To: gandalf@x-planet.org
Organization: FIAG
Supersedes: <1jjhc5am4nehy$.dlg@gandalf.my-fqdn.de>
X-Face: &]^_njQjKuBI.th%)W1+ESkFY4E:r*#8}rkHLF'QTLo, >mql9aGkV*, v.-,
 qVdu&8Xk(6K
X-Headers: Move along, nothing to see here.
Lines: 48
X-Complaints-To: abuse@x-privat.net