2024-06-02 02:34:56 +03:00
|
|
|
use chrono::NaiveDateTime;
|
|
|
|
|
|
|
|
use crate::types::{
|
2024-06-05 13:13:24 +03:00
|
|
|
structs::countable_time::CountableTime, traits::countable_interface::ICountable, TimeValues,
|
2024-06-02 02:34:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
use super::unrestrict_date::unrestrict_date;
|
|
|
|
|
|
|
|
pub type ExtractedDuration = (NaiveDateTime, String, i64);
|
|
|
|
|
|
|
|
pub fn get_duration(time: TimeValues) -> ExtractedDuration {
|
|
|
|
let time_duration = time.0.extract();
|
|
|
|
let unmute_date = unrestrict_date(time_duration);
|
|
|
|
let postfix = CountableTime::from_value(time_duration)
|
|
|
|
.get_postfix(time.0)
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
(unmute_date, postfix, time_duration)
|
|
|
|
}
|