summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpa Singh <shilpa.singh@samsung.com>2014-03-06 21:18:50 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-06 21:23:17 +0900
commit1829c6476281e023eb39c256d22b24e4039be383 (patch)
treea5d77bcf2c7e61f74c37e58173fce06020923336
parentacecd21fc44c9533fe1c8aaa7592d55e6bb12b80 (diff)
Avoid Month wrapping by ignoring summer time correction.
Summary: This patch fixes the issue of month wrapping due to summer time correction is some locales by ignoring day light saving mode in mktime Signed-off by: M.V.K Sumanth <sumanth.m@samsung.com> @fix Test Plan: Change the date for month were day light saving mode is applied and observe the wrapping. Reviewers: seoz, Hermet, raster Reviewed By: raster CC: govi, raster Differential Revision: https://phab.enlightenment.org/D590
-rw-r--r--src/lib/elm_datetime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/elm_datetime.c b/src/lib/elm_datetime.c
index f5df6bd21..ebb1abcc5 100644
--- a/src/lib/elm_datetime.c
+++ b/src/lib/elm_datetime.c
@@ -577,14 +577,14 @@ _max_days_get(int year,
577 localtime_r(&t, &time1); 577 localtime_r(&t, &time1);
578 time1.tm_year = year; 578 time1.tm_year = year;
579 time1.tm_mon = month; 579 time1.tm_mon = month;
580 /* To restrict month wrapping because of summer time in some locales,
581 * disable day light saving mode.*/
582 time1.tm_isdst = 0;
583 for (day = MIN_DAYS_IN_MONTH; day <= mapping[ELM_DATETIME_DATE].def_max; 580 for (day = MIN_DAYS_IN_MONTH; day <= mapping[ELM_DATETIME_DATE].def_max;
584 day++) 581 day++)
585 { 582 {
586 time1.tm_mday = day; 583 time1.tm_mday = day;
587 mktime(&time1); 584 mktime(&time1);
585 /* To restrict month wrapping because of summer time in some locales,
586 * ignore day light saving mode in mktime(). */
587 time1.tm_isdst = -1;
588 if (time1.tm_mday == 1) break; 588 if (time1.tm_mday == 1) break;
589 } 589 }
590 day--; 590 day--;