WorldClock: Missing timezones and locations added. 10/104910/4
authorRadoslaw Czerski <r.czerski@samsung.com>
Tue, 20 Dec 2016 13:08:12 +0000 (14:08 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 21 Dec 2016 07:54:24 +0000 (23:54 -0800)
Change-Id: I8ea12add325245efba9e69b1d08c224ee098150f
Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
clock/src/Model/WorldClock.cpp
clock/src/View/WorldClockView.cpp

index a77e16b..b6713af 100644 (file)
@@ -79,14 +79,14 @@ std::vector<model::Location> WorldClock::locations_ = {
                              { "Doha", "Qatar", 3 * 60, 437, 213 },
                              { "Nairobi", "Kenia", 3 * 60, 409, 263 },
                              { "Moscow", "Russia", 3 * 60, 410, 155 },
-                             { "Tehran", "Iran", 210, 435, 192 },
+                             { "Tehran", "Iran", 3 * 60 + 30, 435, 192 },
                              { "Izhevsk", "Russia", 4 * 60, 437, 152 },
                              { "Dubai", "United Arab Emirates", 4 * 60, 441, 213 },
-                             { "Kabul", "Afghanistan", 270, 464, 194 },
+                             { "Kabul", "Afghanistan", 4 * 60 + 30, 464, 194 },
                              { "Islamabad", "Pakistan", 5 * 60, 467, 196 },
                              { "Tashkent", "Uzbekistan", 5 * 60, 467, 182 },
-                             { "Delhi", "India", 330, 481, 203 },
-                             { "Kathmandu", "Nepal", 345, 494, 204 },
+                             { "Delhi", "India", 5 * 60 + 30, 481, 203 },
+                             { "Kathmandu", "Nepal", 5 * 60 + 45, 494, 204 },
                              { "Almaty", "Kazakhstan", 6 * 60, 481, 177 },
                              { "Bishkek", "Kyrgyzstan", 6 * 60, 477, 179 },
                              { "Dhaka", "Bangladesh", 6 * 60, 504, 213 },
@@ -105,7 +105,13 @@ std::vector<model::Location> WorldClock::locations_ = {
                              { "Sydney", "Australia", 10 * 60, 613, 326 },
                              { "Noumea", "New Caledonia", 11 * 60, 639, 304 },
                              { "Khabarowsk", "Russia", 11 * 60, 584, 169 },
-                             { "Auckland", "New Zealand", 12 * 60, 654, 328 } };
+                             { "Auckland", "New Zealand", 12 * 60, 654, 328 },
+                             { "Nuku'alofa", "Tonga", 13 * 60, 668, 304 },
+                             { "Caracas", "Venezuela", -4 * 60 - 30, 219, 247 },
+                             { "St John's", "Newfoundland", -3 * 60 - 30, 249, 166 },
+                             { "Yangon", "Myanmar", 6 * 60 + 30, 516, 232 },
+                             { "Adelaide", "Australia", 9 * 60 + 30, 603, 332 },
+};
 
 std::vector<Timezone> WorldClock::time_zones_ = {
                                 { 44, 24, -11 * 60, {L[0], L[1]}},
@@ -115,7 +121,9 @@ std::vector<Timezone> WorldClock::time_zones_ = {
                                 { 146, 30, -7 * 60, {L[7]}},
                                 { 146, 47, -6 * 60, {L[8], L[9], L[10], L[11]}},
                                 { 193, 32, -5 * 60, {L[12], L[13], L[14], L[15], L[16], L[17]}},
+                                { 193, 61, -270, {L[77]}},
                                 { 193, 61, -4 * 60, {L[18], L[19]}},
+                                { 225, 59, -210, {L[78]}},
                                 { 225, 59, -3 * 60, {L[20], L[21], L[22], L[23]}},
                                 { 254, 54, -2 * 60, {L[24], L[25]}},
                                 { 284, 24, -1 * 60, {L[26], L[27]}},
@@ -130,12 +138,15 @@ std::vector<Timezone> WorldClock::time_zones_ = {
                                 { 458, 28, 330, {L[55]}}, /*(5.5 * 60)*/
                                 { 486, 28, 345, {L[56]}}, /* (5.75 * 60) */
                                 { 458, 56, 6 * 60, {L[57], L[58], L[59], L[60]}},
+                                { 498, 24, 390, {L[79]}},
                                 { 514, 24, 7 * 60, {L[61], L[62], L[63]}},
                                 { 514, 54, 8 * 60, {L[64], L[65], L[66], L[67], L[68], L[69]}},
                                 { 538, 84, 9 * 60, {L[70], L[71]}},
+                                { 538, 84, 570, {L[80]}},
                                 { 595, 27, 10 * 60, {L[72]}},
                                 { 568, 76, 11 * 60, {L[73], L[74]}},
-                                { 644, 24, 12 * 60, {L[75]}} };
+                                { 644, 24, 12 * 60, {L[75]}},
+                                { 655, 24, 13 * 60, {L[76]}} };
 
 WorldClock::WorldClock()
 {
index f5af0fc..b4d7ee0 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <vector>
 #include <sstream>
+#include <cmath>
 
 #include <efl_extension.h>
 #include <eina_str.h>
@@ -715,7 +716,7 @@ const char *WorldClockView::OffsetToString(int offset)
        char remainder_str[6];
        static char tz_offset[6] = { 0, };
 
-       remainder = (offset % 60) * 100 / 60;
+       remainder = (std::abs(offset) % 60) * 100 / 60;
        snprintf(remainder_str, 3, "%d", (remainder % 10) ? remainder : remainder / 10);
 
        snprintf(tz_offset, 6, "%s%d%s%s", (offset < 0) ? "" : "+", offset / 60,