summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2011-09-18 05:15:11 +0200
committerJavier S. Pedro <maemo@javispedro.com>2011-09-18 05:15:11 +0200
commit03af539d69d903dfb5df19b447707a35ebaa4a54 (patch)
tree11e5cdfacf3678e42efa4324653e5da479f92fc5
parent975189e29d80c07fadeb4d7a8654e25ca16a8db8 (diff)
downloadsowatch-03af539d69d903dfb5df19b447707a35ebaa4a54.tar.gz
sowatch-03af539d69d903dfb5df19b447707a35ebaa4a54.zip
fixing day of the week issue
-rw-r--r--metawatch/metawatch.cpp3
-rw-r--r--sowatch.pro.user2
2 files changed, 3 insertions, 2 deletions
diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp
index e6d8ea6..08b9890 100644
--- a/metawatch/metawatch.cpp
+++ b/metawatch/metawatch.cpp
@@ -178,7 +178,8 @@ void MetaWatch::setDateTime(const QDateTime &dateTime)
msg.data[1] = date.year() & 0xFF;
msg.data[2] = date.month();
msg.data[3] = date.day();
- msg.data[4] = date.dayOfWeek() - 1;
+ // Qt week starts on Monday([1-7]), MW starts on Sunday([0-6]).
+ msg.data[4] = date.dayOfWeek() % 7;
msg.data[5] = time.hour();
msg.data[6] = time.minute();
msg.data[7] = time.second();
diff --git a/sowatch.pro.user b/sowatch.pro.user
index d7bc3e6..7f97a16 100644
--- a/sowatch.pro.user
+++ b/sowatch.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by Qt Creator 2.3.0, 2011-09-18T04:59:41. -->
+<!-- Written by Qt Creator 2.3.0, 2011-09-18T05:08:05. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>