From dherring at tentpost.com Mon Dec 22 04:36:30 2008 From: dherring at tentpost.com (Daniel Herring) Date: Sun, 21 Dec 2008 23:36:30 -0500 (EST) Subject: [local-time-devel] format-timestring :wday bug Message-ID: Thanks for developing local-time; I'm using it to generate the TeX sources for a pocket calendar... FWIW, I stumbled across a noncritical bug: (format-timestring nil (now) :format '(:day)) works but (format-timestring nil (now) :format '(:wday)) doesn't. I suspect this was a minor oversight. - Daniel From attila.lendvai at gmail.com Mon Dec 22 11:24:27 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 22 Dec 2008 12:24:27 +0100 Subject: [local-time-devel] format-timestring :wday bug In-Reply-To: References: Message-ID: > works but > (format-timestring nil (now) :format '(:wday)) > doesn't. (local-time:format-timestring nil (now) :format '(:long-weekday)) "Monday" use the source, luke! :) -- attila ps: i had no idea, i also had to check the source... ps2: there are full-features locale dependent formatters in the cldr branch of cl-l10n: http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cl-l10n-cl-l10n.cldr;a=summary ps3: i'll merge back the cldr branch to head soon From dherring at tentpost.com Mon Dec 22 18:50:02 2008 From: dherring at tentpost.com (dherring at tentpost.com) Date: Mon, 22 Dec 2008 13:50:02 -0500 (EST) Subject: [local-time-devel] format-timestring :wday bug In-Reply-To: References: Message-ID: >> works but >> (format-timestring nil (now) :format '(:wday)) >> doesn't. > > (local-time:format-timestring nil (now) :format '(:long-weekday)) > "Monday" > > use the source, luke! :) I don't follow. The docstrings (and HTML/PDF docs) indicate :wday should print "1" for Monday. But that wasn't implemented in the version I downloaded. - Daniel From attila.lendvai at gmail.com Tue Dec 23 01:34:09 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 23 Dec 2008 02:34:09 +0100 Subject: [local-time-devel] format-timestring :wday bug In-Reply-To: References: Message-ID: > I don't follow. The docstrings (and HTML/PDF docs) indicate :wday should > print "1" for Monday. But that wasn't implemented in the version I > downloaded. i didn't know you needed numeric weekdays. it was not supported, only partial remains of it were in the docstring, probably due to the fact that this is locale dependent. in spite of this i've added a :weekday directive that documents the start offset and the meaning of the printed number (following the us locale, where the week starts with sunday). get or pull the darcs repo for the fix. if you just need the numeric value, you can also use with-decoded-timestamp to extract it. fyi, cl-l10n has some support for formatting local-time timestamps in a locale dependent manner, but not even the CLDR xml's have information about the first day of the week for now, so only localized textual weekday presentation is supported by cl-l10n at the moment. hth, -- attila ps: Daniel (Lowe), speak up or just push the change if you have different intentions with this!