[elm_datetime] Fix to consider second field while comparing datetime values.
authorSubodh Kumar <s7158.kumar@samsung.com>
Tue, 24 Mar 2015 22:09:23 +0000 (07:09 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 24 Mar 2015 22:09:23 +0000 (07:09 +0900)
Summary:
Some app like calendar, they heavily depend on the value of datetime,so to ensure accuracy
second field is considered while comparing datetime values.

@fix

Test Plan: NA

Reviewers: shilpasingh, raster

Reviewed By: shilpasingh, raster

Subscribers: poornima.srinivasan, govi, rajeshps

Differential Revision: https://phab.enlightenment.org/D2204

legacy/elementary/src/lib/elm_datetime.c

index d2a7a7c..dd1826c 100644 (file)
@@ -46,7 +46,8 @@
      &(tmptr)->tm_mon,                   \
      &(tmptr)->tm_mday,                  \
      &(tmptr)->tm_hour,                  \
-     &(tmptr)->tm_min}
+     &(tmptr)->tm_min,                  \
+     &(tmptr)->tm_sec}
 
 // default limits for individual fields
 static Format_Map mapping[ELM_DATETIME_TYPE_COUNT] = {
@@ -589,7 +590,7 @@ _date_cmp(struct tm *time1,
    DATETIME_TM_ARRAY(timearr1, time1);
    DATETIME_TM_ARRAY(timearr2, time2);
 
-   for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT - 1; idx++)
+   for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
      {
         if (*timearr1[idx] != *timearr2[idx])
           return EINA_FALSE;