summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/klocale.cpp17
-rw-r--r--microkde/kdecore/klocale.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 17031c7..8b4513e 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -607,24 +607,41 @@ QDateTime KLocale::readDateTime(const QString &intstr,
607 *ok = false; 607 *ok = false;
608 else 608 else
609 *ok = true; 609 *ok = true;
610 } 610 }
611 QDateTime m_dt; 611 QDateTime m_dt;
612 m_dt.setDate(m_date); 612 m_dt.setDate(m_date);
613 m_dt.setTime(m_time); 613 m_dt.setTime(m_time);
614 614
615 qDebug("KLocale::readDateTime() transformed %s into %s (%s), %s (%s) : err1=%i, err2=%i", intstr.latin1(), date.latin1(), dformat.latin1(), time.latin1(), tformat.latin1(), ok1, ok2); 615 qDebug("KLocale::readDateTime() transformed %s into %s (%s), %s (%s) : err1=%i, err2=%i", intstr.latin1(), date.latin1(), dformat.latin1(), time.latin1(), tformat.latin1(), ok1, ok2);
616 return m_dt; 616 return m_dt;
617} 617}
618 618
619QDate KLocale::readDate(const QString &intstr,
620 IntDateFormat intIntDateFormat,
621 bool* ok) const
622{
623 bool ok1;
624
625 QString dformat = dateFormat(intIntDateFormat);
626
627 QDate m_date = readDate(intstr, dformat, &ok1);
628
629 if (ok)
630 *ok = ok1;
631
632 //qDebug("KLocale::readDate() transformed %s into %s (%s), %s (%s) : err1=%i, err2=%i", intstr.latin1(), date.latin1(), dformat.latin1(), time.latin1(), tformat.latin1(), ok1, ok2);
633 return m_date;
634}
635
619 636
620bool KLocale::use12Clock() const 637bool KLocale::use12Clock() const
621{ 638{
622 return !mHourF24Format ;; 639 return !mHourF24Format ;;
623} 640}
624 641
625bool KLocale::weekStartsMonday() const 642bool KLocale::weekStartsMonday() const
626{ 643{
627 return mWeekStartsMonday; 644 return mWeekStartsMonday;
628} 645}
629 646
630int KLocale::weekStartDay() const 647int KLocale::weekStartDay() const
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h
index 949301a..5783530 100644
--- a/microkde/kdecore/klocale.h
+++ b/microkde/kdecore/klocale.h
@@ -44,24 +44,26 @@ class KLocale
44 enum IntDateFormat { Undefined=-1, Default=0, Format1=1, ISODate=2, Userdefined=3 }; 44 enum IntDateFormat { Undefined=-1, Default=0, Format1=1, ISODate=2, Userdefined=3 };
45 45
46 QString formatDate(const QDate &pDate, bool shortFormat = false, IntDateFormat intIntDateFormat = Undefined) const; 46 QString formatDate(const QDate &pDate, bool shortFormat = false, IntDateFormat intIntDateFormat = Undefined) const;
47 QString formatTime(const QTime &pTime, bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; 47 QString formatTime(const QTime &pTime, bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const;
48 QString formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat = Undefined) const; 48 QString formatDateTime(const QDateTime &pDateTime, IntDateFormat intIntDateFormat = Undefined) const;
49 QString formatDateTime(const QDateTime &pDateTime, 49 QString formatDateTime(const QDateTime &pDateTime,
50 bool shortFormat, 50 bool shortFormat,
51 bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const; 51 bool includeSecs = false, IntDateFormat intIntDateFormat = Undefined) const;
52 52
53 QDate readDate(const QString &str, bool* ok = 0) const; 53 QDate readDate(const QString &str, bool* ok = 0) const;
54 QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const; 54 QDate readDate( const QString &intstr, const QString &fmt, bool* ok = 0) const;
55 QTime readTime(const QString &str, bool* ok = 0) const; 55 QTime readTime(const QString &str, bool* ok = 0) const;
56 QDate readDate(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const;
57
56 QDateTime readDateTime(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const; 58 QDateTime readDateTime(const QString &intstr, IntDateFormat intIntDateFormat, bool* ok) const;
57 59
58 bool use12Clock() const; 60 bool use12Clock() const;
59 bool weekStartsMonday() const; 61 bool weekStartsMonday() const;
60 int weekStartDay() const; 62 int weekStartDay() const;
61 63
62 QString weekDayName(int,bool=false) const; 64 QString weekDayName(int,bool=false) const;
63 QString monthName(int,bool=false) const; 65 QString monthName(int,bool=false) const;
64 66
65 QString country() const; 67 QString country() const;
66 68
67 QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const; 69 QString dateFormat(IntDateFormat intIntDateFormat = Undefined) const;