Selaa lähdekoodia

The common editor returns after calling the secondary editor and cannot be refreshed -- common editor 调用次级editor 后返回无法刷新(resolve: #14708)
Common editor date type cell cannot pop up date selection -- common editor 日期类型单元格无法弹出日期选择(resolve: #14709)

Ray Zhang 4 vuotta sitten
vanhempi
commit
9a2408ca37

+ 9 - 5
ApexDrivers/CommonEditorLib/src/main/java/com/usai/commoneditorlib/CommonEditorActivity.java

@@ -1021,7 +1021,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
 
             content_data_control = translateChange(content_data_download,changed_data);
 
-            if (!refresh) {
+            if (refresh) {
 
                 if (restore_json != null) {
                     int rc = restore_json.optInt("count");
@@ -2501,10 +2501,14 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
                     if (type.toLowerCase().equals("date")) {
                         pickerMode = 0; // Date
                         dateFormatter.applyPattern("MM/dd/yyyy");
-
-                        Date date = dateFormatter.parse(value);
                         final Calendar c = Calendar.getInstance();
-                        c.setTime(date);
+                        if(!TextUtils.isEmpty(value))
+                        {
+                            Date date = dateFormatter.parse(value);
+                            c.setTime(date);
+                        }
+
+
                         new DatePickerDialog(CommonEditorActivity.this,
                                 new DatePickerDialog.OnDateSetListener()
                                 {
@@ -2544,7 +2548,7 @@ public class CommonEditorActivity extends AppCompatActivity implements View.OnLa
                     }
                     else {
                         pickerMode = 2; // date and time
-                        dateFormatter.applyPattern("yyyy/MM/dd HH:mm:ss");
+                        dateFormatter.applyPattern("MM/dd/yyyy HH:mm:ss");
                     }
 
 //                    Date date = dateFormatter.parse(value);