From 36bce069094733cb68531fab7e9ae7e8b7f500ad Mon Sep 17 00:00:00 2001 From: Kyler Chin <7539174+kylerchin@users.noreply.github.com> Date: Sat, 6 Jan 2024 23:03:33 -0800 Subject: [PATCH] Adjust for Winter quarter --- src/static/process.rs | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/static/process.rs b/src/static/process.rs index 2918b8b..3b87489 100644 --- a/src/static/process.rs +++ b/src/static/process.rs @@ -821,8 +821,8 @@ async fn main() { friday: true, saturday: false, sunday: false, - start_date: chrono::naive::NaiveDate::from_ymd_opt(2023,09,25).unwrap(), - end_date: chrono::naive::NaiveDate::from_ymd_opt(2023,12,15).unwrap(), + start_date: chrono::naive::NaiveDate::from_ymd_opt(2024,1,8).unwrap(), + end_date: chrono::naive::NaiveDate::from_ymd_opt(2024,3,22).unwrap(), }).unwrap(); let calendar_csv = String::from_utf8(calendarwriter.into_inner().unwrap()).unwrap(); @@ -832,23 +832,20 @@ async fn main() { let mut calendardateswriter = Writer::from_writer(vec![]); - calendardateswriter.serialize(gtfs_structures::CalendarDate { - service_id: String::from("fri"), - date: chrono::naive::NaiveDate::from_ymd_opt(2023,11,10).unwrap(), - exception_type: gtfs_structures::Exception::Deleted, - }).unwrap(); - - calendardateswriter.serialize(gtfs_structures::CalendarDate { - service_id: String::from("monthurs"), - date: chrono::naive::NaiveDate::from_ymd_opt(2023,11,23).unwrap(), - exception_type: gtfs_structures::Exception::Deleted, - }).unwrap(); - - calendardateswriter.serialize(gtfs_structures::CalendarDate { - service_id: String::from("fri"), - date: chrono::naive::NaiveDate::from_ymd_opt(2023,11,24).unwrap(), - exception_type: gtfs_structures::Exception::Deleted, - }).unwrap(); + let cancellations = [ + //MLK JR DAY + ((2024,01,15), "monthurs"), + //President's day + ((2024,02,19), "monthurs") + ]; + + for cancel in cancellations { + calendardateswriter.serialize(gtfs_structures::CalendarDate { + service_id: String::from(cancel.1), + date: chrono::naive::NaiveDate::from_ymd_opt(cancel.0.0,cancel.0.1, cancel.0.2).unwrap(), + exception_type: gtfs_structures::Exception::Deleted, + }).unwrap(); + } //write now