Phase 0.3: migrate date formatting to date-fns
This commit is contained in:
@@ -438,13 +438,14 @@ export function decodeMimeHeader(value: string | undefined | null): string {
|
||||
* Variables: {{user.name}}, {{user.first_name}}, {{user.last_name}},
|
||||
* {{user.email}}, {{user.role}}, {{tenant.name}}, {{date}}
|
||||
*/
|
||||
import { formatDateShort } from '@/utils/date';
|
||||
|
||||
export function replaceSignatureVariables(
|
||||
html: string,
|
||||
user: { name?: string; email?: string; role?: string; first_name?: string; last_name?: string },
|
||||
tenant?: { name?: string },
|
||||
): string {
|
||||
const now = new Date();
|
||||
const dateStr = now.toLocaleDateString([], { year: 'numeric', month: '2-digit', day: '2-digit' });
|
||||
const dateStr = formatDateShort(new Date());
|
||||
const firstName = user.first_name || (user.name ? user.name.split(' ')[0] : '');
|
||||
const lastName = user.last_name || (user.name ? user.name.split(' ').slice(1).join(' ') : '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user