mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #25845 -- Fixed incorrect timezone warnings in custom admin templates.
This commit is contained in:
		
				
					committed by
					
						 Tim Graham
						Tim Graham
					
				
			
			
				
	
			
			
			
						parent
						
							d91cc25a2a
						
					
				
				
					commit
					9af40f5df1
				
			| @@ -21,7 +21,7 @@ | ||||
|         init: function() { | ||||
|             var body = document.getElementsByTagName('body')[0]; | ||||
|             var serverOffset = body.getAttribute('data-admin-utc-offset'); | ||||
|             if (serverOffset !== undefined) { | ||||
|             if (serverOffset) { | ||||
|                 var localOffset = new Date().getTimezoneOffset() * -60; | ||||
|                 DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; | ||||
|             } | ||||
| @@ -43,7 +43,7 @@ | ||||
|         now: function() { | ||||
|             var body = document.getElementsByTagName('body')[0]; | ||||
|             var serverOffset = body.getAttribute('data-admin-utc-offset'); | ||||
|             if (serverOffset !== undefined) { | ||||
|             if (serverOffset) { | ||||
|                 var localNow = new Date(); | ||||
|                 var localOffset = localNow.getTimezoneOffset() * -60; | ||||
|                 localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user