Logo
Explore Help
Register Sign In
immich-app/immich
1
0
Fork 0
You've already forked immich
mirror of https://github.com/immich-app/immich.git synced 2025-12-25 09:14:58 +03:00
Code Issues Packages Projects Releases 18 Wiki Activity
Files
77926383dbfa6e7dc9ffe08b2975b18bce55ee92
immich/server/src/utils/date.ts

4 lines
141 B
TypeScript
Raw Normal View History

fix(server): adjust type of person.birthDate (#16628) 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.
2025-03-09 22:32:05 -04:00
export const asDateString = (x: Date | string | null): string | null => {
return x instanceof Date ? x.toISOString().split('T')[0] : x;
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 106ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API