summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Adams <chris.adams@qinetic.com.au>2020-11-02 12:46:27 +1000
committerChris Adams <chris.adams@qinetic.com.au>2020-11-02 13:20:18 +1000
commita66590d473753bc49105d3132fb9e4150c92a14a (patch)
treecba5dbab6ea22760baefc69f6938b9664b1779aa
parentf34cf2ff2b0f428d5b8a70763b29088075ebbd1c (diff)
Fix calendardemo example
Change-Id: I335707590afec9b39e7813c7a6acc2499fce22dd Reviewed-by: Christopher Adams <chris.adams@jolla.com>
-rw-r--r--examples/organizer/calendardemo/src/calendardemo.cpp6
-rw-r--r--examples/organizer/calendardemo/src/monthpage.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/organizer/calendardemo/src/calendardemo.cpp b/examples/organizer/calendardemo/src/calendardemo.cpp
index c5c669622..5b7958d55 100644
--- a/examples/organizer/calendardemo/src/calendardemo.cpp
+++ b/examples/organizer/calendardemo/src/calendardemo.cpp
@@ -265,7 +265,7 @@ void CalendarDemo::activatePreviousPage()
void CalendarDemo::addNewEvent()
{
QOrganizerEvent newEvent;
- QDateTime time(m_currentDate);
+ QDateTime time(m_currentDate.startOfDay());
newEvent.setStartDateTime(time);
time = time.addSecs(60*30); // add 30 minutes to end time
newEvent.setEndDateTime(time);
@@ -275,7 +275,7 @@ void CalendarDemo::addNewEvent()
void CalendarDemo::addNewTodo()
{
QOrganizerTodo newTodo;
- QDateTime time(m_currentDate);
+ QDateTime time(m_currentDate.startOfDay());
newTodo.setStartDateTime(time);
time = time.addSecs(60*30); // add 30 minutes to due time
newTodo.setDueDateTime(time);
@@ -285,7 +285,7 @@ void CalendarDemo::addNewTodo()
void CalendarDemo::addNewJournal()
{
QOrganizerJournal newJournal;
- QDateTime time(m_currentDate);
+ QDateTime time(m_currentDate.startOfDay());
newJournal.setDateTime(time);
activateEditPage(newJournal);
}
diff --git a/examples/organizer/calendardemo/src/monthpage.cpp b/examples/organizer/calendardemo/src/monthpage.cpp
index d53d6f60e..1ff26824c 100644
--- a/examples/organizer/calendardemo/src/monthpage.cpp
+++ b/examples/organizer/calendardemo/src/monthpage.cpp
@@ -48,6 +48,7 @@
**
****************************************************************************/
+#include <QLocale>
#include <QtWidgets>
#include <QtOrganizer/qorganizer.h>
#include <QtOrganizer/qorganizerabstractrequest.h>
@@ -285,12 +286,11 @@ void MonthPage::refreshDayItems()
m_itemList->addItem("(no entries)");
}
-
void MonthPage::currentMonthChanged()
{
int month = m_calendarWidget->monthShown();
int year = m_calendarWidget->yearShown();
- m_dateLabel->setText(QString("%1 %2").arg(QDate::longMonthName(month)).arg(year));
+ m_dateLabel->setText(QString("%1 %2").arg(QLocale().standaloneMonthName(month)).arg(year));
refresh();
m_ignoreShowDayPageOnceFlag = true;
}