forked from Ruderverein-Donau-Linz/rowt
		
	rebase to rowt #12
@@ -1,8 +1,8 @@
 | 
			
		||||
use std::io::Write;
 | 
			
		||||
 | 
			
		||||
use chrono::NaiveDate;
 | 
			
		||||
use chrono::{Duration, NaiveDate, NaiveTime};
 | 
			
		||||
use ics::{
 | 
			
		||||
    properties::{DtStart, Summary},
 | 
			
		||||
    properties::{DtEnd, DtStart, Summary},
 | 
			
		||||
    ICalendar,
 | 
			
		||||
};
 | 
			
		||||
use serde::Serialize;
 | 
			
		||||
@@ -452,6 +452,20 @@ WHERE trip_details.id=?
 | 
			
		||||
            self.day.replace('-', ""),
 | 
			
		||||
            self.planned_starting_time.replace(':', "")
 | 
			
		||||
        )));
 | 
			
		||||
 | 
			
		||||
        let original_time = NaiveTime::parse_from_str(&self.planned_starting_time, "%H:%M")
 | 
			
		||||
            .expect("Failed to parse time");
 | 
			
		||||
        let later_time = original_time + Duration::hours(3);
 | 
			
		||||
        if later_time > original_time {
 | 
			
		||||
            // Check if no day-overflow
 | 
			
		||||
            let time_three_hours_later = later_time.format("%H%M").to_string();
 | 
			
		||||
            vevent.push(DtEnd::new(format!(
 | 
			
		||||
                "{}T{}00",
 | 
			
		||||
                self.day.replace('-', ""),
 | 
			
		||||
                time_three_hours_later
 | 
			
		||||
            )));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        let tripdetails = self.trip_details(db).await;
 | 
			
		||||
        let mut name = String::new();
 | 
			
		||||
        if self.is_cancelled() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
use chrono::{Local, NaiveDate};
 | 
			
		||||
use ics::properties::{DtStart, Summary};
 | 
			
		||||
use chrono::{Duration, Local, NaiveDate, NaiveTime};
 | 
			
		||||
use ics::properties::{DtEnd, DtStart, Summary};
 | 
			
		||||
use serde::Serialize;
 | 
			
		||||
use sqlx::SqlitePool;
 | 
			
		||||
 | 
			
		||||
@@ -145,6 +145,20 @@ WHERE trip_details.id=?
 | 
			
		||||
            self.day.replace('-', ""),
 | 
			
		||||
            self.planned_starting_time.replace(':', "")
 | 
			
		||||
        )));
 | 
			
		||||
 | 
			
		||||
        let original_time = NaiveTime::parse_from_str(&self.planned_starting_time, "%H:%M")
 | 
			
		||||
            .expect("Failed to parse time");
 | 
			
		||||
        let later_time = original_time + Duration::hours(3);
 | 
			
		||||
        if later_time > original_time {
 | 
			
		||||
            // Check if no day-overflow
 | 
			
		||||
            let time_three_hours_later = later_time.format("%H%M").to_string();
 | 
			
		||||
            vevent.push(DtEnd::new(format!(
 | 
			
		||||
                "{}T{}00",
 | 
			
		||||
                self.day.replace('-', ""),
 | 
			
		||||
                time_three_hours_later
 | 
			
		||||
            )));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        let mut name = String::new();
 | 
			
		||||
        if self.is_cancelled() {
 | 
			
		||||
            name.push_str("ABGESAGT");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user