dev #25

Merged
akulij merged 38 commits from dev into main 2025-06-18 17:10:44 +00:00
Showing only changes of commit 93852b9155 - Show all commits

View File

@ -955,15 +955,19 @@ impl RunnerConfig {
} }
pub fn created_at(&self) -> DateTime<Utc> { pub fn created_at(&self) -> DateTime<Utc> {
self.created_at.at + TimeDelta::try_hours(self.config.timezone.into()).unwrap() self.timezoned_time(self.created_at.at)
}
pub fn timezoned_time(&self, dt: DateTime<Utc>) -> DateTime<Utc> {
dt + TimeDelta::try_hours(self.config.timezone.into())
.unwrap_or_else(|| TimeDelta::try_hours(0).expect("Timezone UTC+0 does not exists"))
} }
/// if None is returned, then garanteed that later calls will also return None, /// if None is returned, then garanteed that later calls will also return None,
/// so, if you'll get None, no notifications will be provided later /// so, if you'll get None, no notifications will be provided later
pub fn get_nearest_notifications(&self) -> Option<NotificationBlock> { pub fn get_nearest_notifications(&self) -> Option<NotificationBlock> {
let start_time = self.created_at(); let start_time = self.created_at();
let now = let now = self.timezoned_time(chrono::offset::Utc::now());
chrono::offset::Utc::now() + TimeDelta::try_hours(self.config.timezone.into()).unwrap();
let ordered = self let ordered = self
.notifications .notifications