Article View: news.software.readers
Article #143361Re: Dialog - Date String
From: Jeff Relf
Date: Wed, 11 Feb 2004 09:25
Date: Wed, 11 Feb 2004 09:25
51 lines
3025 bytes
3025 bytes
Hi CyberDroog,
Re: How to display a fixed-length short-date
in the article list,
You comment,
" I don't really care for the time a message was posted,
and I want the date field to be a fixed length ",
I only ever keep 5 days worth of posts ,
so I never want to see the month , much less the year .
My time stamp now looks like this :
3 9.02 // The 3rd day , AM , 9:02
18. 10.15 // The 18th day , PM , 10:15
^ This is the PM indicator ,
The entire timestamp is always 9 characters wide .
The script below only works for the m/d/yy short-date ...
Program OnArticleListPaint;
function OnArticleListPaint( PaintString: widestring;
ColumnIndex: integer ): widestring;
var X: Integer;
MM_DD, HH_MM_SS_AM, BHH_MM, Day, PM, H, M : WideString;
begin
case ColumnIndex of 3: // Date column , from 0
begin
X := pos( '/', paintstring);
MM_DD := copy( paintstring, X+ 1, 2 );
X := pos( ' ', paintstring);
BHH_MM := copy( paintstring, X, 6 );
HH_MM_SS_AM := copy( paintstring, X + 1, 10 );
X := pos( ' ', HH_MM_SS_AM);
PM := copy( HH_MM_SS_AM, X + 1, 1 );
if PM = 'P' then PM := '.' else PM := ' ';
Day := copy( MM_DD, 1, 2);
if copy( Day, 2, 1) = '/' then
Day := ' ' + copy( Day, 1, 1);
if copy( BHH_MM, 3, 1) = ':' then begin
H := copy( BHH_MM, 1, 2); M := copy( BHH_MM, 4, 2);
end else begin
H := copy( BHH_MM, 2, 2); M := copy( BHH_MM, 5, 2);
end;
paintstring :=
Day + PM + ' ' + H + '.' + M ;
end;
end; // case
result := paintstring;
end;
begin end.
Technical Details
Message-ID:
<xlw4lkdwfo31.dlg@x.Jeff.Relf>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!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!64-40-51-97.ncplus.NET!not-for-mailReferences:
<1261byxeudi8t.3yagcawaom1k$.dlg@40tude.net> <16l7nag1zuu64.dlg@aosrr.com> <02md20d6dlot23lun328jou51hk92sheob@4ax.com>Show Full Headers
Complete Article Headers
Message-ID: <xlw4lkdwfo31.dlg@x.Jeff.Relf>
Subject: Re: Dialog - Date String
Date: Wed, 11 Feb 2004 01:25:56 -0800
From: Jeff Relf <Me@Privacy.NET>
References: <1261byxeudi8t.3yagcawaom1k$.dlg@40tude.net> <16l7nag1zuu64.dlg@aosrr.com> <02md20d6dlot23lun328jou51hk92sheob@4ax.com>
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!intern1.nntp.aus1.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!64-40-51-97.ncplus.NET!not-for-mail
Newsgroups: news.software.readers
Lines: 51
NNTP-Posting-Host: 64-40-51-97.ncplus.net (64.40.51.97)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 1076491528 39579717 D 64.40.51.97 ([177113])
User-Agent: 40tude_Dialog/2.0.10.1 (5a40af0e.474.44)
X-Face: V|9[5IY]/OB15+<DlkA6*rsaeJb?9HnEE@[CAy1koT:N4Ew'*#35g{6z1>}/e:m!6.qw'Kzn@$#""CJQl/Uv"R,&G?sNO"{#LEEnS3lQRnT#Ql#'3ySQ80}u7Q<`+B@;
Y; 81AnK'_PD^fm.3T/<-i~YdZ%Q}b?:-]{Lr#s6.N,r(}
X-Newsreader: Win98 C++