Fixed timezone bug (same as motus)
This commit is contained in:
		
							parent
							
								
									632351031f
								
							
						
					
					
						commit
						32093281d6
					
				| 
						 | 
				
			
			@ -7,7 +7,11 @@ export function getCurrentDate(): Date {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
export function getCurrentSessionKey(): string {
 | 
			
		||||
  return getCurrentDate().toISOString().slice(0, 10)
 | 
			
		||||
  const now = getCurrentDate()
 | 
			
		||||
  // https://stackoverflow.com/a/28149561
 | 
			
		||||
  const tzoffset = now.getTimezoneOffset() * 60000
 | 
			
		||||
  const localISOTime = new Date(now.getTime() - tzoffset).toISOString()
 | 
			
		||||
  return localISOTime.slice(0, 10)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// #region RNG
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user