Fix linting issues in timezone implementation
Co-authored-by: berry-13 <81851188+berry-13@users.noreply.github.com>
This commit is contained in:
@@ -38,7 +38,8 @@ export default function createPayload(submission: t.TSubmission) {
|
||||
conversationId,
|
||||
isContinued: !!(isEdited && isContinued),
|
||||
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 };
|
||||
|
||||
@@ -451,7 +451,7 @@ export function replaceSpecialVars({
|
||||
|
||||
const localDatetime = dayjs().tz(timezone).format('YYYY-MM-DD HH:mm:ss');
|
||||
result = result.replace(/{{local_datetime}}/gi, `${localDatetime} (${localDayNumber})`);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// If timezone is invalid, fall back to UTC values for local_* variables
|
||||
result = result.replace(/{{local_date}}/gi, combinedDate);
|
||||
result = result.replace(/{{local_datetime}}/gi, `${currentDatetime} (${dayNumber})`);
|
||||
|
||||
Reference in New Issue
Block a user