mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	(core) Convert datetime objects in Date columns to timestamps at midnight of the date
Summary: Changes Date.do_convert to fix a bug noticed in https://grist.slack.com/archives/C069RUP71/p1643044498033400 Test Plan: Existing tests, and tested manually that the use case with the summary table was fixed Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3233
This commit is contained in:
		
							parent
							
								
									a685707d50
								
							
						
					
					
						commit
						8aa6ddba0b
					
				@ -287,7 +287,7 @@ class Date(Numeric):
 | 
			
		||||
    if value in ("", None):
 | 
			
		||||
      return None
 | 
			
		||||
    elif isinstance(value, datetime.datetime):
 | 
			
		||||
      return moment.dt_to_ts(value)
 | 
			
		||||
      return moment.date_to_ts(value.date())
 | 
			
		||||
    elif isinstance(value, datetime.date):
 | 
			
		||||
      return moment.date_to_ts(value)
 | 
			
		||||
    elif isinstance(value, (float, six.integer_types)):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user