Skip to content

Commit cf668cf

Browse files
committed
fix for ci
1 parent 5ebd970 commit cf668cf

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

backend/app/services/implementations/user_service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from uuid import UUID
44

55
import firebase_admin.auth
6+
import firebase_admin.exceptions
67
from fastapi import HTTPException
78
from sqlalchemy.orm import Session, joinedload
89
from sqlalchemy.sql import func
@@ -87,7 +88,7 @@ async def create_user(self, user: UserCreateRequest) -> UserCreateResponse:
8788
if firebase_user:
8889
try:
8990
firebase_admin.auth.delete_user(firebase_user.uid)
90-
except firebase_admin.auth.AuthError as firebase_error:
91+
except firebase_admin.exceptions.FirebaseError as firebase_error:
9192
self.logger.error(
9293
"Failed to delete Firebase user after database insertion failed"
9394
f"Firebase UID: {firebase_user.uid}. "
@@ -187,7 +188,7 @@ async def delete_user_by_id(self, user_id: str):
187188
try:
188189
firebase_admin.auth.delete_user(firebase_auth_id)
189190
self.logger.info(f"Successfully deleted Firebase user {firebase_auth_id}")
190-
except firebase_admin.auth.AuthError as firebase_error:
191+
except firebase_admin.exceptions.FirebaseError as firebase_error:
191192
# Log error but don't fail - DB deletion already succeeded
192193
self.logger.error(
193194
f"Failed to delete Firebase user {firebase_auth_id} after database deletion: {str(firebase_error)}"

frontend/src/utils/dateUtils.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,21 @@ export function formatDateShort(dateString: string): string {
3636

3737
/**
3838
* Format a date to show full date (e.g., "February 26, 2024")
39-
* @param dateString - ISO 8601 datetime string
39+
* @param dateString - ISO 8601 date string (YYYY-MM-DD) or datetime string
4040
* @returns Formatted date string
4141
*/
4242
export function formatDateLong(dateString: string): string {
43-
const date = new Date(dateString);
43+
// For date-only strings (YYYY-MM-DD), parse as local date to avoid timezone issues
44+
// For datetime strings, use as-is
45+
let date: Date;
46+
if (/^\d{4}-\d{2}-\d{2}$/.test(dateString)) {
47+
// Date-only format: parse as local date
48+
const [year, month, day] = dateString.split('-').map(Number);
49+
date = new Date(year, month - 1, day);
50+
} else {
51+
// Datetime format: parse normally
52+
date = new Date(dateString);
53+
}
4454
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' });
4555
}
4656

0 commit comments

Comments
 (0)