summaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorPraveen Arimbrathodiyil <pravi.a@gmail.com>2009-01-12 07:41:43 -0800
committerPraveen Arimbrathodiyil <pravi.a@gmail.com>2009-01-12 07:41:43 -0800
commit5f92ff207510ad516728c69ae3f8ad7885289914 (patch)
treec7e1506d93a8c475f4e1a4786f532d2ad608f933 /calendar
parent50e6feb068dacabc60f928826158eb4bebc5cc8f (diff)
downloadRachana.git-5f92ff207510ad516728c69ae3f8ad7885289914.tar.gz
Rachana.git-5f92ff207510ad516728c69ae3f8ad7885289914.tar.xz
Rachana.git-5f92ff207510ad516728c69ae3f8ad7885289914.zip
trying to debug addMonths
Diffstat (limited to 'calendar')
-rw-r--r--calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp
index e44d2ef..471db9b 100644
--- a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp
+++ b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp
@@ -251,8 +251,9 @@ QDate KCalendarSystemIndic::addMonths( const QDate &date, int nmonths ) const
saka_year = KCalendarSystemIndic::year( date );
saka_month = KCalendarSystemIndic::month( date );
saka_day = KCalendarSystemIndic::day( date );
+ kDebug() << "before" << saka_year << saka_month << saka_day;
change = saka_month + nmonths;
- if (change < 0 ) {
+ if (change <= 0 ) {
saka_year -= ( abs(change)/12 + 1 );
saka_month = 12 + change%12;
}
@@ -262,6 +263,9 @@ QDate KCalendarSystemIndic::addMonths( const QDate &date, int nmonths ) const
} else {
saka_month += nmonths;
}
+ kDebug() << "after" << saka_year << saka_month << saka_day << KCalendarSystemSaka::SakaToJD(saka_year, saka_month, saka_day);
+ QDate test = QDate::fromJulianDay( KCalendarSystemSaka::SakaToJD(saka_year, saka_month, saka_day) );
+ kDebug() << "year" << KCalendarSystemIndic::year (test);
return QDate::fromJulianDay( KCalendarSystemSaka::SakaToJD(saka_year, saka_month, saka_day) );
}