Skip to content

Commit 0c8c8cf

Browse files
committed
fix: resolve TypeScript errors in session command
- Fix type safety issue with optional session ID parameter - Update formatDateCompact to accept optional locale parameter
1 parent 4d91107 commit 0c8c8cf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/commands/session.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const sessionCommand = define({
176176

177177
// Handle specific session ID lookup
178178
if (ctx.values.id != null) {
179-
await handleSessionIdLookup(ctx, useJson);
179+
await handleSessionIdLookup({ ...ctx, values: { ...ctx.values, id: ctx.values.id } }, useJson);
180180
return;
181181
}
182182

‎src/data-loader.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,9 @@ export function formatDate(dateStr: string, timezone?: string, locale?: string):
568568
* @param locale - Locale to use for formatting
569569
* @returns Formatted date string with newline separator (YYYY\nMM-DD)
570570
*/
571-
export function formatDateCompact(dateStr: string, timezone: string | undefined, locale: string): string {
571+
export function formatDateCompact(dateStr: string, timezone: string | undefined, locale: string | undefined): string {
572572
const date = new Date(dateStr);
573-
const formatter = createDatePartsFormatter(timezone, locale);
573+
const formatter = createDatePartsFormatter(timezone, locale ?? 'en-US');
574574
const parts = formatter.formatToParts(date);
575575
const year = parts.find(p => p.type === 'year')?.value ?? '';
576576
const month = parts.find(p => p.type === 'month')?.value ?? '';

0 commit comments

Comments
 (0)