gluon/src/utils/general/get_expiration_time.rs

20 lines
562 B
Rust
Raw Normal View History

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