Gnus development mailing list
 help / color / mirror / Atom feed
From: Frank Schmitt <usereplyto@Frank-Schmitt.net>
Subject: Re: [patch] age depending date-format
Date: Wed, 17 Oct 2001 18:09:42 +0200	[thread overview]
Message-ID: <1yk29rjt.fsf@hschmi22.userfqdn.rz-online.de> (raw)
In-Reply-To: <u7ktu71dy.fsf@amdocs.com>

"Yair Friedman (Jerusalem)" <YAIRFR@amdocs.com> writes:

>>gnus-user-date formats the date accordingly to 
>>gnus-user-date-day
>>gnus-user-date-week
>>gnus-user-date-old
>
>Can we have gnus-user-date-month and gnus-user-date-year as well?

I'm just working on it. I'll do it the Gnus way: As configurable as
possible. Therefor I'll do it like ShengHuo suggested:

gnus-user date calculates the difference between the current date and
the date it gets as argument. Then it looks in a variable
gnus-user-date-format-alist for the first element with a value bigger
than the calculated difference and format the date according to the
specified value.

gnus-user-date-format-alist will look like this:

(defvar gnus-user-data-format-alist
 '((seconds-today "%k:%M")
   (604800 "%a %k:%M")
   (seconds-this-month "%a %d")
   (seconds-this-year "%b %d")
   (t "%b %m '%y)) ;;this one is used when no other does match
  "Blah blah")

The seconds-* are (will be) functions which return the seconds since
today 00:00, since the 1st of this month 00:00, since the 1st of january
of this year 00:00.

So today the function would do the following:
gnus-user-date("Wed, 17 Oct 2001 13:34:39 +0200")=13:39
gnus-user-date("Sun, 14 Oct 2001 13:34:39 +0200")=Sun 13:39
gnus-user-date("Sun, 07 Oct 2001 13:34:39 +0200")=Sun 17
gnus-user-date("Sun, 30 Sep 2001 13:34:39 +0200")=Sep 30
gnus-user-date("Sun, 14 Oct 1999 13:34:39 +0200")=Oct 14 '99

Are this nice default values? I don't really know about the
international conventions for this.

-- 
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them
In the Land of Mordor where the Shadows lie.
19. Dezember 2001



      reply	other threads:[~2001-10-17 16:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-16 19:42 Frank Schmitt
2001-10-16 20:52 ` ShengHuo ZHU
2001-10-17  7:16   ` Frank Schmitt
2001-10-17 16:09     ` ShengHuo ZHU
2001-10-17 16:34       ` Frank Schmitt
2001-10-17 11:50   ` Kai Großjohann
2001-10-17 13:59     ` ShengHuo ZHU
2001-10-17 14:08       ` Didier Verna
2001-10-17 14:11         ` Colin Marquardt
2001-10-17 14:36           ` Didier Verna
2001-10-17 15:05         ` Kai Großjohann
2001-10-17 15:33           ` Didier Verna
2001-10-17 15:30         ` Paul Jarc
2001-10-17 15:41           ` Didier Verna
2001-10-17 16:14           ` Per Abrahamsen
2001-10-17 16:19             ` Paul Jarc
2001-10-17 16:37               ` Simon Josefsson
2001-10-17 16:52               ` Kai Großjohann
2001-10-17 17:03                 ` Paul Jarc
2001-10-17 18:11                   ` Per Abrahamsen
2001-10-17 18:08               ` Per Abrahamsen
2001-10-17 16:20           ` Amos Gouaux
2001-10-17 16:51           ` Kai Großjohann
2001-10-18  6:44             ` Yair Friedman (Jerusalem)
2001-10-17 15:09       ` Per Abrahamsen
2001-10-17 15:15       ` Per Abrahamsen
2001-10-17 15:19         ` Kai Großjohann
2001-10-17 16:04           ` ShengHuo ZHU
2001-10-17 20:35   ` Update of gnus-user-date (was: [patch] age depending date-format) Frank Schmitt
2001-10-17 21:34     ` ShengHuo ZHU
2001-10-18  7:53       ` Update of gnus-user-date Frank Schmitt
2001-10-18 10:08         ` Kai Großjohann
2001-10-19 17:11     ` Update of gnus-user-date (was: [patch] age depending date-format) Wes Hardaker
2001-10-17 10:51 ` [patch] age depending date-format Frank Schmitt
2001-10-17 15:05 ` Yair Friedman (Jerusalem)
2001-10-17 16:09   ` Frank Schmitt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1yk29rjt.fsf@hschmi22.userfqdn.rz-online.de \
    --to=usereplyto@frank-schmitt.net \
    --cc=usenet@Frank-Schmitt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).