mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-02 14:20:18 +01:00
Fix linting issues in timezone implementation
Co-authored-by: berry-13 <81851188+berry-13@users.noreply.github.com>
This commit is contained in:
parent
9fe4554a70
commit
3c4c4d53dd
2 changed files with 3 additions and 2 deletions
|
|
@ -38,7 +38,8 @@ export default function createPayload(submission: t.TSubmission) {
|
||||||
conversationId,
|
conversationId,
|
||||||
isContinued: !!(isEdited && isContinued),
|
isContinued: !!(isEdited && isContinued),
|
||||||
ephemeralAgent: s.isAssistantsEndpoint(endpoint) ? undefined : ephemeralAgent,
|
ephemeralAgent: s.isAssistantsEndpoint(endpoint) ? undefined : ephemeralAgent,
|
||||||
timezone: typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : undefined,
|
timezone:
|
||||||
|
typeof Intl !== 'undefined' ? Intl.DateTimeFormat().resolvedOptions().timeZone : undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
return { server, payload };
|
return { server, payload };
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ export function replaceSpecialVars({
|
||||||
|
|
||||||
const localDatetime = dayjs().tz(timezone).format('YYYY-MM-DD HH:mm:ss');
|
const localDatetime = dayjs().tz(timezone).format('YYYY-MM-DD HH:mm:ss');
|
||||||
result = result.replace(/{{local_datetime}}/gi, `${localDatetime} (${localDayNumber})`);
|
result = result.replace(/{{local_datetime}}/gi, `${localDatetime} (${localDayNumber})`);
|
||||||
} catch (error) {
|
} catch {
|
||||||
// If timezone is invalid, fall back to UTC values for local_* variables
|
// If timezone is invalid, fall back to UTC values for local_* variables
|
||||||
result = result.replace(/{{local_date}}/gi, combinedDate);
|
result = result.replace(/{{local_date}}/gi, combinedDate);
|
||||||
result = result.replace(/{{local_datetime}}/gi, `${currentDatetime} (${dayNumber})`);
|
result = result.replace(/{{local_datetime}}/gi, `${currentDatetime} (${dayNumber})`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue