diff options
author | Praveen Arimbrathodiyil <pravi.a@gmail.com> | 2009-01-10 22:17:50 -0800 |
---|---|---|
committer | Praveen Arimbrathodiyil <pravi.a@gmail.com> | 2009-01-10 22:17:50 -0800 |
commit | 04980e890401cffaed25d21fe8bba76e334c3955 (patch) | |
tree | 53af82e9fd4628e11c7a1bb08498a4552917257c /calendar | |
parent | 1130904f73ab064023172271b2b6e9db44352938 (diff) | |
download | Rachana.git-04980e890401cffaed25d21fe8bba76e334c3955.tar.gz Rachana.git-04980e890401cffaed25d21fe8bba76e334c3955.tar.xz Rachana.git-04980e890401cffaed25d21fe8bba76e334c3955.zip |
Now the calendar works. setYMD/setDate was getting values in Saka
but we assumed it was in Gregorian.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp index 8028d47..d8840da 100644 --- a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp +++ b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp @@ -59,7 +59,7 @@ public: * month The month according to Indian calendar (between 1 to 12) * date The date in month */ - double KCalendarSystemSaka::SakaToJD(int year, int month, int date) { + double KCalendarSystemSaka::SakaToJD(int year, int month, int day) { int leapMonth, gyear, m; double start, jd; @@ -75,7 +75,7 @@ public: } if (month == 1) { - jd = start + (date - 1); + jd = start + (day - 1); } else { jd = start + leapMonth; m = month - 2; @@ -85,7 +85,7 @@ public: m = month - 7; jd += m * 30; } - jd += date - 1; + jd += day - 1; } return jd; @@ -143,13 +143,16 @@ bool KCalendarSystemIndic::isValid( const QDate &date ) const bool KCalendarSystemIndic::setDate( QDate &date, int year, int month, int day ) const { - return KCalendarSystem::setDate( date, year, month, day ); + // Gets its value in Saka that need to be converted into Gregorian + kDebug() << "setDate: year, month , day"<< year << month << day; + date = QDate::fromJulianDay( KCalendarSystemSaka::SakaToJD(year, month, day) ); + return true; } // Deprecated bool KCalendarSystemIndic::setYMD( QDate &date, int y, int m, int d ) const { - return KCalendarSystem::setDate( date, y, m, d ); + return KCalendarSystemIndic::setDate( date, y, m, d ); } int KCalendarSystemIndic::year( const QDate &date ) const |