summaryrefslogtreecommitdiffstats
path: root/mbbsd/calendar.c
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-24 21:08:17 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-04-24 21:08:17 +0800
commitf27721b033d921e063c039db94a133fc9ddefaa7 (patch)
treeb9444bbe01ac99fd59c4cf131b23f5af76d8ac51 /mbbsd/calendar.c
parent749cbf02649e66d486a98bbe4ae9ac9d620f9ce9 (diff)
downloadpttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar.gz
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar.bz2
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar.lz
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar.xz
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.tar.zst
pttbbs-f27721b033d921e063c039db94a133fc9ddefaa7.zip
bad date of horoscope
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3507 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/calendar.c')
-rw-r--r--mbbsd/calendar.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c
index 60cbd59a..76c899f7 100644
--- a/mbbsd/calendar.c
+++ b/mbbsd/calendar.c
@@ -330,18 +330,19 @@ calendar(void)
int getHoroscope(int m, int d)
{
- if (m > 11 || m < 0)
+ if (m > 12 || m < 1)
return 1;
- // 摩羯 水瓶 雙魚 白羊 金牛 雙子 巨蟹 獅子 處女 天秤 天蠍 射手
+ // Return: 1 .. 12
+ // 摩羯 水瓶 雙魚 牡羊 金牛 雙子 巨蟹 獅子 處女 天秤 天蠍 射手
const int firstday[12] = {
- /* Dec. */ 22, /* Jan. */ 20, 19, 21, 20, 21, 21, 23, 23, 23, 23, 22
+ /* Jan. */ 20, 19, 21, 20, 21, 21, 23, 23, 23, 23, 22, 22
};
- if (d >= firstday[m]) {
+ if (d >= firstday[m - 1]) {
if (m == 12)
return 1;
else
- return m - 1;
+ return m + 1;
}
else
return m;