diff options
author | Praveen Arimbrathodiyil <pravi.a@gmail.com> | 2009-01-06 00:58:35 -0800 |
---|---|---|
committer | Praveen Arimbrathodiyil <pravi.a@gmail.com> | 2009-01-06 00:58:35 -0800 |
commit | 9158fb708f412efcf25bbfb7410f7d1adebabef7 (patch) | |
tree | 9abe435064e6986fac9efd2a1352c7cfe70bbe22 /calendar | |
parent | df2fdef3c511667d0cf9432313ef2be7395f1740 (diff) | |
download | Rachana.git-9158fb708f412efcf25bbfb7410f7d1adebabef7.tar.gz Rachana.git-9158fb708f412efcf25bbfb7410f7d1adebabef7.tar.xz Rachana.git-9158fb708f412efcf25bbfb7410f7d1adebabef7.zip |
epoch, earliestValidDate and latestValidDate is added to test cases and functions fixed.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/kde/kdelibs/kdecore/date/.kcalendarsystemindic.cpp.swp | bin | 0 -> 16384 bytes | |||
-rw-r--r-- | calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp | 7 | ||||
-rw-r--r-- | calendar/kde/kdelibs/kdecore/tests/kcalendartest.cpp | 12 |
3 files changed, 10 insertions, 9 deletions
diff --git a/calendar/kde/kdelibs/kdecore/date/.kcalendarsystemindic.cpp.swp b/calendar/kde/kdelibs/kdecore/date/.kcalendarsystemindic.cpp.swp Binary files differnew file mode 100644 index 0000000..11e34fd --- /dev/null +++ b/calendar/kde/kdelibs/kdecore/date/.kcalendarsystemindic.cpp.swp diff --git a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp index fe2addf..9f88d74 100644 --- a/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp +++ b/calendar/kde/kdelibs/kdecore/date/kcalendarsystemindic.cpp @@ -107,12 +107,14 @@ QString KCalendarSystemIndic::calendarType() const QDate KCalendarSystemIndic::epoch() const { - return QDate::fromJulianDay( 1721426 ); + // Saka Era starts at 22 March 79 in Gregarian Calendar + // We get 23 March 79 if convert back from Julian day 1749994.5 :-( + return QDate::fromString( "00790322", "yyyyMMdd" ); } QDate KCalendarSystemIndic::earliestValidDate() const { - return QDate::fromJulianDay( 1 ); + return KCalendarSystem::earliestValidDate(); } QDate KCalendarSystemIndic::latestValidDate() const @@ -166,7 +168,6 @@ int KCalendarSystemIndic::year( const QDate &date ) const return saka_year; - return KCalendarSystem::year( date ); } int KCalendarSystemIndic::month( const QDate &date ) const diff --git a/calendar/kde/kdelibs/kdecore/tests/kcalendartest.cpp b/calendar/kde/kdelibs/kdecore/tests/kcalendartest.cpp index fc775b2..32d5a6a 100644 --- a/calendar/kde/kdelibs/kdecore/tests/kcalendartest.cpp +++ b/calendar/kde/kdelibs/kdecore/tests/kcalendartest.cpp @@ -308,14 +308,14 @@ void KCalendarTest::testJalaliBasic() void KCalendarTest::testIndicBasic() { - const KCalendarSystem *calendar = KCalendarSystem::create(QString( "jalali" )); + const KCalendarSystem *calendar = KCalendarSystem::create(QString( "indic" )); - QCOMPARE( calendar->calendarType(), QString("jalali") ); - QCOMPARE( KCalendarSystem::calendarLabel( QString("jalali") ), QString("Jalali") ); + QCOMPARE( calendar->calendarType(), QString("indic") ); + QCOMPARE( KCalendarSystem::calendarLabel( QString("indic") ), QString("Indic") ); - QCOMPARE( calendar->epoch(), QDate( 622, 3, 19 ) ); - QCOMPARE( calendar->earliestValidDate(), QDate( 622, 3, 19 ) ); - QCOMPARE( calendar->latestValidDate(), QDate( 10621, 3, 17 ) ); + QCOMPARE( calendar->epoch(), QDate( 79, 3, 22 ) ); + QCOMPARE( calendar->earliestValidDate(), QDate( 79, 3, 22 ) ); + QCOMPARE( calendar->latestValidDate(), QDate( 9999, 12, 31 ) ); testValid( calendar, 10000, 13, 32, QDate( 1, 1, 1 ) ); |