mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:17:11 -05:00 
			
		
		
		
	The API currently does not respect the documentation when returning a person's birthDate. The doc/swagger says it will be of "YYYY-MM-DD" format but the string is a full ISO8601-with-tz string. This causes issue #16216 because the <input> tag is strict about supported value formats. I believe this was introduced by #15242 which switched some queries from TypeORM to Kysely for the person repository. TypeORM does not parse date, but our Kysely configuration does (explicitely). This commits updates the types to represent both possibilities and ensure the API always returns the correct format.
		
			
				
	
	
		
			4 lines
		
	
	
		
			141 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			4 lines
		
	
	
		
			141 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
export const asDateString = (x: Date | string | null): string | null => {
 | 
						|
  return x instanceof Date ? x.toISOString().split('T')[0] : x;
 | 
						|
};
 |