summaryrefslogtreecommitdiffstats
path: root/libkcal/htmlexport.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /libkcal/htmlexport.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkcal/htmlexport.cpp')
-rw-r--r--libkcal/htmlexport.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/libkcal/htmlexport.cpp b/libkcal/htmlexport.cpp
index fd994fca2..c945b88f0 100644
--- a/libkcal/htmlexport.cpp
+++ b/libkcal/htmlexport.cpp
@@ -34,6 +34,7 @@
#include <libkcal/calendar.h>
#include <libkcal/event.h>
+#include <libkcal/incidenceformatter.h>
#include <libkcal/todo.h>
#ifndef KORG_NOKABC
@@ -184,20 +185,23 @@ void HtmlExport::createMonthView(TQTextStream *ts)
*ts << "</td></tr><tr><td valign=\"top\">";
- Event::List events = mCalendar->events( start,
- EventSortStartDate,
- SortDirectionAscending );
- if (events.count()) {
- *ts << "<table>";
- Event::List::ConstIterator it;
- for( it = events.begin(); it != events.end(); ++it ) {
+ // Only print events within the from-to range
+ if ( start >= fromDate() && start <= toDate() ) {
+ Event::List events = mCalendar->events( start,
+ EventSortStartDate,
+ SortDirectionAscending );
+ if (events.count()) {
+ *ts << "<table>";
+ Event::List::ConstIterator it;
+ for( it = events.begin(); it != events.end(); ++it ) {
if ( checkSecrecy( *it ) ) {
createEvent( ts, *it, start, false );
}
+ }
+ *ts << "</table>";
+ } else {
+ *ts << "&nbsp;";
}
- *ts << "</table>";
- } else {
- *ts << "&nbsp;";
}
*ts << "</td></tr></table></td>\n";
@@ -275,12 +279,16 @@ void HtmlExport::createEvent (TQTextStream *ts, Event *event,
if (event->isMultiDay() && (event->dtStart().date() != date)) {
*ts << " <td>&nbsp;</td>\n";
} else {
- *ts << " <td valign=\"top\">" << event->dtStartTimeStr() << "</td>\n";
+ *ts << " <td valign=\"top\">"
+ << IncidenceFormatter::timeToString( event->dtStart(), true )
+ << "</td>\n";
}
if (event->isMultiDay() && (event->dtEnd().date() != date)) {
*ts << " <td>&nbsp;</td>\n";
} else {
- *ts << " <td valign=\"top\">" << event->dtEndTimeStr() << "</td>\n";
+ *ts << " <td valign=\"top\">"
+ << IncidenceFormatter::timeToString( event->dtEnd(), true )
+ << "</td>\n";
}
} else {
*ts << " <td>&nbsp;</td><td>&nbsp;</td>\n";
@@ -459,7 +467,7 @@ void HtmlExport::createTodo (TQTextStream *ts,Todo *todo)
if (completed) *ts << " class=\"done\"";
*ts << ">\n";
if (todo->hasDueDate()) {
- *ts << " " << todo->dtDueDateStr() << "\n";
+ *ts << " " << IncidenceFormatter::dateToString( todo->dtDue( true ) ) << "\n";
} else {
*ts << " &nbsp;\n";
}