Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions crates/goose-server/src/routes/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ use axum::{
};
use serde::{Deserialize, Serialize};

use chrono::NaiveDateTime;

use crate::state::AppState;
use goose::scheduler::ScheduledJob;

Expand Down Expand Up @@ -82,12 +80,6 @@ pub struct SessionDisplayInfo {
accumulated_output_tokens: Option<i32>,
}

fn parse_session_name_to_iso(session_name: &str) -> String {
NaiveDateTime::parse_from_str(session_name, "%Y%m%d_%H%M%S")
.map(|dt| dt.and_utc().to_rfc3339())
.unwrap_or_else(|_| String::new()) // Fallback to empty string if parsing fails
}

#[utoipa::path(
post,
path = "/schedule/create",
Expand Down Expand Up @@ -326,7 +318,7 @@ async fn sessions_handler(
display_infos.push(SessionDisplayInfo {
id: session_name.clone(),
name: session.name,
created_at: parse_session_name_to_iso(&session_name),
created_at: session.created_at.to_rfc3339(),
working_dir: session.working_dir.to_string_lossy().into_owned(),
schedule_id: session.schedule_id,
message_count: session.message_count,
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/schedule/ScheduleDetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ const ScheduleDetailView: React.FC<ScheduleDetailViewProps> = ({ scheduleId, onN
</h3>
<p className="text-xs text-text-subtle mt-1">
Created:{' '}
{session.createdAt ? new Date(session.createdAt).toLocaleString() : 'N/A'}
{session.createdAt ? formatToLocalDateWithTimezone(session.createdAt) : 'N/A'}
</p>
{session.messageCount !== undefined && (
<p className="text-xs text-text-subtle mt-1">
Expand Down
Loading