forked from Public/pics
		
	GenericTable: better handling of null values for timestamps
This commit is contained in:
		
							parent
							
								
									219260c57f
								
							
						
					
					
						commit
						3dfda45681
					
				@ -62,6 +62,7 @@ class ManageUsers extends HTMLController
 | 
			
		||||
						'type' => 'timestamp',
 | 
			
		||||
						'pattern' => 'long',
 | 
			
		||||
						'value' => 'last_action_time',
 | 
			
		||||
						'if_null' => 'n/a',
 | 
			
		||||
					],
 | 
			
		||||
					'header' => 'Last activity',
 | 
			
		||||
					'is_sortable' => true,
 | 
			
		||||
 | 
			
		||||
@ -226,8 +226,8 @@ class GenericTable
 | 
			
		||||
			else
 | 
			
		||||
				$pattern = $options['pattern'];
 | 
			
		||||
 | 
			
		||||
			assert(isset($rowData[$options['value']]));
 | 
			
		||||
			if (!is_numeric($rowData[$options['value']]))
 | 
			
		||||
			assert(array_key_exists($options['value'], $rowData));
 | 
			
		||||
			if (isset($rowData[$options['value']]) && !is_numeric($rowData[$options['value']]))
 | 
			
		||||
				$timestamp = strtotime($rowData[$options['value']]);
 | 
			
		||||
			else
 | 
			
		||||
				$timestamp = (int) $rowData[$options['value']];
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user