mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
* feat(geolocation): add geolocation utility * feat(web): geolocation utility - fix code review - 1 * feat(web): geolocation utility - fix code review - 2 * chore: cleanup * chore: feedback * feat(web): add animation and text animation on locations change and action text on thumbnail * styling, messages and filtering * selected color * format i18n * fix lint --------- Co-authored-by: Jason Rasmussen <jason@rasm.me> Co-authored-by: Alex <alex.tran1502@gmail.com>
18 lines
531 B
TypeScript
18 lines
531 B
TypeScript
export const removeAccents = (str: string) => {
|
|
return str.normalize('NFD').replaceAll(/[\u0300-\u036F]/g, '');
|
|
};
|
|
|
|
export const normalizeSearchString = (str: string) => {
|
|
return removeAccents(str.toLocaleLowerCase());
|
|
};
|
|
|
|
export const buildDateString = (year: number, month?: number, day?: number) => {
|
|
return [
|
|
year.toString(),
|
|
month && !Number.isNaN(month) ? month.toString() : undefined,
|
|
day && !Number.isNaN(day) ? day.toString() : undefined,
|
|
]
|
|
.filter((date) => date !== undefined)
|
|
.join('-');
|
|
};
|