9fans archive / 2000 / 12 / 3 /    prev next

From: anothy@cos...
Subject: [9fans] calendar diff
Date: Fri, 1 Dec 2000 11:02:21 -0500

the following small change to calendar.c will
allow it to recognize YYYY/MM/DD style dates,
in addition to all the ones it curently knows
about. a minor bug is that 2000/012/023 looks
like a valid date.
-α.

diff new/calendar.c old/calendar.c
122,123c122,123
< 		"(^| |\t)(%d( |\t|/)+)?((%s( |\t)+)|(0?%d/))0?%d( |\t|$)",
< 		tm->year+1900, mo, tm->mon+1, tm->mday);
---
> 		"(^| |\t)((%s( |\t)+)|(%d/))%d( |\t|$)",
> 		mo, tm->mon+1, tm->mday);