keycloak fix

This commit is contained in:
2025-07-01 13:45:20 +07:00
parent 1532ef6db8
commit 78b75999ea
13 changed files with 235 additions and 71 deletions

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
export function capitalizeEachWord(text: string) {
// const lowercase = text.toLowerCase();
// return lowercase.charAt(0).toUpperCase() + lowercase.slice(1);
return text
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}
export function timestampToDate(timestamp: number, locale: string, options = {}) {
const date = new Date(timestamp * 1000);
// locale forma --> `id-ID`
return date.toLocaleString(locale, {
// timeZone: options.timeZone,
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZoneName: 'short',
...options
});
}