summaryrefslogtreecommitdiff
path: root/library/calendar.cpp
Unidiff
Diffstat (limited to 'library/calendar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/calendar.cpp56
1 files changed, 51 insertions, 5 deletions
diff --git a/library/calendar.cpp b/library/calendar.cpp
index b9ef585..c7536c3 100644
--- a/library/calendar.cpp
+++ b/library/calendar.cpp
@@ -20,19 +20,65 @@
20#include "calendar.h" 20#include "calendar.h"
21 21
22#include <qdatetime.h> 22#include <qdatetime.h>
23#include <qobject.h>
24
25/*! \class Calendar calendar.html
26
27 \brief The Calendar class provides programmers with an easy to calculate
28 and get information about dates, months and years.
29
30 \ingroup qtopiaemb
31*/
32
33
34
35static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() {
36 (void)QObject::tr("Jan");
37 (void)QObject::tr("Feb");
38 (void)QObject::tr("Mar");
39 (void)QObject::tr("Apr");
40 (void)QObject::tr("May");
41 (void)QObject::tr("Jun");
42 (void)QObject::tr("Jul");
43 (void)QObject::tr("Aug");
44 (void)QObject::tr("Sep");
45 (void)QObject::tr("Oct");
46 (void)QObject::tr("Nov");
47 (void)QObject::tr("Dec");
48 (void)QObject::tr("Mon");
49 (void)QObject::tr("Tue");
50 (void)QObject::tr("Wed");
51 (void)QObject::tr("Thu");
52 (void)QObject::tr("Fri");
53 (void)QObject::tr("Sat");
54 (void)QObject::tr("Sun");
55}
56
57
58
59/*!
60 Returns the name of the month for \a m.
61 Equivalent to QDate::monthName().
62*/
23 63
24QString Calendar::nameOfMonth( int m ) 64QString Calendar::nameOfMonth( int m )
25{ 65{
26 QDate d; 66 QDate d;
27 return d.monthName( m ); 67 qDebug( d.monthName( m ) );
68 return QObject::tr( d.monthName( m ) );
28} 69}
29 70
71/*!
72 Returns the name of the day for \a d.
73 Equivalent to QDate::dayName().
74*/
30QString Calendar::nameOfDay( int d ) 75QString Calendar::nameOfDay( int d )
31{ 76{
32 QDate dt; 77 QDate dt;
33 return dt.dayName( d ); 78 return QObject::tr( dt.dayName( d ) );
34} 79}
35 80
81/*! \obsolete */
36QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month, 82QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month,
37 bool startWithMonday ) 83 bool startWithMonday )
38{ 84{
@@ -41,17 +87,17 @@ QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month,
41 int firstDay = temp.dayOfWeek(); 87 int firstDay = temp.dayOfWeek();
42 int i; 88 int i;
43 QDate prev; 89 QDate prev;
44 QValueList<Day> days; 90 QValueList<Day> days;
45 91
46 if ( startWithMonday ) 92 if ( startWithMonday )
47 i = 1; 93 i = 1;
48 else 94 else
49 i = 0; 95 i = 0;
50 96
51 if ( month > 1 ) 97 if ( month > 1 )
52 prev.setYMD( year, month - 1, 1 ); 98 prev.setYMD( year, month - 1, 1 );
53 else 99 else
54 prev.setYMD( year - 1, 12, 1 ); 100 prev.setYMD( year - 1, 12, 1 );
55 for ( ; i < firstDay; i++ ) { 101 for ( ; i < firstDay; i++ ) {
56 days.append( Day( prev.daysInMonth() - ( firstDay - i - 1 ), 102 days.append( Day( prev.daysInMonth() - ( firstDay - i - 1 ),
57 Day::PrevMonth, FALSE ) ); 103 Day::PrevMonth, FALSE ) );