[Remind-Fans] week numbers

Guido Arnold guido at fsfe.org
Thu Sep 18 14:05:50 EDT 2008


On Tue, Sep 16, 2008 at 06:16:55PM -0500, Terry Brown wrote:
> > 
> > I've been looking for an option to show the week numbers in the
> > postscript output.
> 
> Hmm, I think I just spent 30 minutes answering the wrong question :-)
> 
> I was thinking, how do you calculate the week number.  It turned out to
> be harder than I though, I ended up with this:

Thank you for going through this! I was almost certain that somebody
must have done this before and I was just too blind to find it. 

But apparently, working with week numbers is not too common among
remind users :)
 
> # day of week (Monday = 0) for Jan. 1 for 'this' year
> SET jan1dow (wkdaynum(date(year(today()), 1, 1))+6)%7
> # days in week 1, the partial week
> SET week1 = 7 - jan1dow
> # Day of year, Jan 1 = 1
> SET doy today() - date(year(today()), 1, 1) + 1
> SET wholeWeeks = (doy-week1)/7
> SET daysLeft = iif(doy > week1, doy-week1-7*wholeWeeks, 0)
> msg Week = [wholeWeeks + sgn(daysLeft) + sgn(week1)]

I see how it should work, although my version (03.00.24.) complains
"Illegal character `='", but I guess that's because I am using an
older version?

I was hoping that this would be as easy as to display a full moon,
but it seems that I will have to tinker a little bit :)

> Anyway, that's what I came up with.
> 
Thanks again for your efforts! I'll post the output of what I can
derive from that.

Cheers,

Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20080918/3d116afa/attachment.pgp>


More information about the Remind-fans mailing list