Selaa lähdekoodia

Unify Android and iOS common editor date formats -- 统一Android 和 iOS common editor日期格式(resolve: #14711)

Ray Zhang 4 vuotta sitten
vanhempi
commit
900021a7b6

+ 2 - 2
RA TradeFiling/RA TradeFiling/TFEditor/TFEditorViewController.m

@@ -376,9 +376,9 @@
         v=v.superview;
     }
     
-    UITableViewCell *cell =v;//(UITableViewCell *) sender.superview.superview.superview;
+    UITableViewCell *cell =(UITableViewCell*)v;//(UITableViewCell *) sender.superview.superview.superview;
     NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
-    int refresh =0;
+//    int refresh =0;
     NSMutableDictionary* section_json=nil;
 
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];

+ 1 - 1
RA TradeFiling/RA TradeFiling/config.h

@@ -13,7 +13,7 @@
 //#define fake_data false
 #ifdef DEBUG
 //    #define test_server
-    #define fake_data true
+    #define fake_data false
 #else
     #define fake_data false
 # endif

+ 1 - 1
common/customUI/commoneditor/CommonEditorRangeCell.m

@@ -134,7 +134,7 @@
     
     NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
     [dateFormatter setDefaultDate:[NSDate date]];
-    [dateFormatter setDateFormat:@"MM/dd/YYYY"];
+    [dateFormatter setDateFormat:@"MM/dd/yyyy"];
     
     DatePickerViewController* dpvc =[ [UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"DatePickerViewController"];
 

+ 21 - 21
common/customUI/commoneditor/CommonEditorViewController.m

@@ -1992,7 +1992,7 @@ if(!self.alert.isBeingDismissed)
     if(is_subaction)
     {
         NSMutableDictionary* sub_action = [[item_json objectForKey:[NSString stringWithFormat:@"item_%d",subaction_tag]] mutableCopy];
-        int refresh = [[sub_action valueForKey:@"refresh"] intValue];
+        bool refresh = [[sub_action valueForKey:@"refresh"] boolValue];
         bool discardDirty = [[sub_action valueForKey:@"discard_dirty"] boolValue];
         NSString* refresh_trigger = [sub_action valueForKey:@"name"];
         NSDictionary * restore_json=[sub_action objectForKeyedSubscript:@"restore"];
@@ -2136,7 +2136,7 @@ if(!self.alert.isBeingDismissed)
         
         
         
-        if(refresh==1)
+        if(refresh)
         {
             
             if(restore_json!=nil)
@@ -2188,7 +2188,7 @@ if(!self.alert.isBeingDismissed)
         
         
         
-        int refresh = [[item_json valueForKey:@"refresh"] intValue];
+        bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
         bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
         NSString* refresh_trigger = [item_json valueForKey:@"name"];
         NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
@@ -2325,7 +2325,7 @@ if(!self.alert.isBeingDismissed)
         
         
         
-        if(refresh==1)
+        if(refresh)
         {
             
             if(restore_json!=nil)
@@ -2559,11 +2559,11 @@ if(!self.alert.isBeingDismissed)
         [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
         self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
         
-        int refresh = [[item_json valueForKey:@"refresh"] intValue];
+        bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
         bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
         NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
         bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
-        if(refresh==1)
+        if(refresh)
         {
             
             if(restore_json!=nil)
@@ -2716,11 +2716,11 @@ if(!self.alert.isBeingDismissed)
         [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
         self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
         
-        int refresh = [[item_json valueForKey:@"refresh"] intValue];
+        bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
         bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
         NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
         bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
-        if(refresh==1)
+        if(refresh)
         {
             
             if(restore_json!=nil)
@@ -3003,7 +3003,7 @@ if(!self.alert.isBeingDismissed)
     //        [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
     //    }
     //
-    //    if(refresh==1)
+    //    if(refresh)
     //    {
     //
     //        if(restore_json!=nil)
@@ -4901,7 +4901,7 @@ if(!self.alert.isBeingDismissed)
         if([[type lowercaseString] isEqualToString:@"date"])
         {
             dpvc.pickerMode = UIDatePickerModeDate;
-            [dateFormatter setDateFormat:@"yyyy/MM/dd"];
+            [dateFormatter setDateFormat:@"MM/dd/yyyy"];
         }
         else if([[type lowercaseString] isEqualToString:@"time"])
         {
@@ -4911,7 +4911,7 @@ if(!self.alert.isBeingDismissed)
         else
         {
             dpvc.pickerMode = UIDatePickerModeDateAndTime;
-            [dateFormatter setDateFormat:@"yyyy/MM/dd HH:mm:ss"];
+            [dateFormatter setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
         }
         
         __weak typeof(self) weakSelf = self;
@@ -5363,7 +5363,7 @@ if(!self.alert.isBeingDismissed)
     //    DebugLog(@"endedit %d_%d",indexPath.section,indexPath.row);
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
     
-    int refresh = [[item_json valueForKey:@"refresh"] intValue];
+    bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
     bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
     NSString* refresh_trigger = [item_json valueForKey:@"name"];
     NSString* subid=[item_json valueForKey:@"subid"];
@@ -5419,7 +5419,7 @@ if(!self.alert.isBeingDismissed)
     //  [self.editorTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
     
     
-    if(refresh==1)
+    if(refresh)
     {
 
             [self refresh:refresh_trigger discardDirty:discardDirty];
@@ -5438,7 +5438,7 @@ if(!self.alert.isBeingDismissed)
     
     
     
-    int refresh = [[item_json valueForKey:@"refresh"] intValue];
+    bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
     bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
     
     NSString* refresh_trigger = [item_json valueForKey:@"name"];
@@ -5488,7 +5488,7 @@ if(!self.alert.isBeingDismissed)
     NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
     
     
-    if(refresh==1)
+    if(refresh)
     {
         
         
@@ -5986,7 +5986,7 @@ if(!self.alert.isBeingDismissed)
     //
     //        NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
     //        bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
-    //        if(refresh==1)
+    //        if(refresh)
     //        {
     //
     //            if(restore_json!=nil)
@@ -6105,7 +6105,7 @@ if(!self.alert.isBeingDismissed)
     //
     //        NSDictionary * restore_json=[item_json objectForKeyedSubscript:@"restore"];
     //        bool partial_refresh=[[item_json valueForKey:@"partial_refresh"] boolValue];
-    //        if(refresh==1)
+    //        if(refresh)
     //        {
     //
     //            if(restore_json!=nil)
@@ -6276,7 +6276,7 @@ if(!self.alert.isBeingDismissed)
     //    DebugLog(@"endedit %d_%d",indexPath.section,indexPath.row);
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
     
-    int refresh = [[item_json valueForKey:@"refresh"] intValue];
+    bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
     bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
     NSString* refresh_trigger = [item_json valueForKey:@"name"];
     NSString* subid=[item_json valueForKey:@"subid"];
@@ -6332,7 +6332,7 @@ if(!self.alert.isBeingDismissed)
     //  [self.editorTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
     
     
-    if(refresh==1)
+    if(refresh)
     {
 
             [self refresh:refresh_trigger discardDirty:discardDirty];
@@ -6362,7 +6362,7 @@ if(!self.alert.isBeingDismissed)
     //    DebugLog(@"endedit %d_%d",indexPath.section,indexPath.row);
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
     
-    int refresh = [[item_json valueForKey:@"refresh"] intValue];
+    bool refresh = [[item_json valueForKey:@"refresh"] boolValue];
     bool discardDirty = [[item_json valueForKey:@"discard_dirty"] boolValue];
     NSString* refresh_trigger = [item_json valueForKey:@"name"];
     NSString* subid=[item_json valueForKey:@"subid"];
@@ -6414,7 +6414,7 @@ if(!self.alert.isBeingDismissed)
     [self.editorTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
     
     
-    if(refresh==1)
+    if(refresh)
     {
 
             [self refresh:refresh_trigger discardDirty:discardDirty];