[elm_datetime] Fix to parse the POSIX locale format properly.
authorSubodh Kumar <s7158.kumar@samsung.com>
Tue, 24 Mar 2015 22:06:03 +0000 (07:06 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 24 Mar 2015 22:06:03 +0000 (07:06 +0900)
Summary:
In POSIX, some format include extra character like dash, hash, etc, which gives unexpected behaviour.
Fix to filter out those character.

Signed Off By: Seongjun Yim <se201.yim@samsung.com>
Signed Off By: Subodh Kumar <s7158.kumar@samsung.com>

@fix

Test Plan:
1. Set datetime as POSIX locale.
2. Check the datetime behaviour in elementary_test.

Reviewers: raster, shilpasingh

Reviewed By: shilpasingh

Subscribers: poornima.srinivasan, govi, rajeshps

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

legacy/elementary/src/lib/elm_datetime.c

index 28f61fa..d2a7a7c 100644 (file)
@@ -259,6 +259,11 @@ _parse_format(Evas_Object *obj,
      {
         if (fmt_parsing)
           {
+             if (cur == '_' || cur == '-' || cur == '0' || cur == '^' || cur == '#')
+               {
+                  fmt_ptr++;
+                  continue;
+               }
              fmt_parsing = EINA_FALSE;
              for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
                {