From 61eb83337daac43e6c048549c0300bdde7af158a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 3 Jun 2010 03:13:37 +0200 Subject: Fixed some off-by-one bugs --- DDate.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'DDate.vala') diff --git a/DDate.vala b/DDate.vala index b29944d..7f9654d 100644 --- a/DDate.vala +++ b/DDate.vala @@ -66,14 +66,14 @@ public struct DDate { } public uchar get_day() { - return (uchar)(get_day_of_year() % 73); + return (uchar)(((get_day_of_year()-1) % 73) + 1); } public DDateMonth get_month() { if(is_st_tibs_day()) return DDateMonth.ST_TIBS_DAY; - return (DDateMonth)(get_day_of_year()/73); + return (DDateMonth)((get_day_of_year()-1)/73); } public DDateWeekday get_weekday() { -- cgit v1.2.3