Since it takes a NaiveDate, don't lie

This commit is contained in:
2024-07-27 21:02:28 +01:00
parent cd3d14c7de
commit 29b2dbd69b
+6 -12
View File
@@ -75,16 +75,16 @@ impl Worker {
pub async fn fetch_within(
&mut self,
start: DateTime<Utc>,
end: DateTime<Utc>,
start: NaiveDate,
end: NaiveDate,
) -> Result<(), AppError> {
let results = self
.toggl_api
.search(
self.toggl_api.workspace_id,
TogglReportFilters {
start_date: Some(start.date_naive()),
end_date: Some(end.date_naive()),
start_date: Some(start),
end_date: Some(end),
..Default::default()
},
)
@@ -388,16 +388,10 @@ async fn main() {
worker.update_tags().await.unwrap();
let start = NaiveDate::from_ymd_opt(2024, 2, 1)
.expect("Invalid date")
.and_hms_opt(0, 0, 0)
.expect("Invalid time")
.and_utc();
.expect("Invalid date");
let end = NaiveDate::from_ymd_opt(2024, 2, 2)
.expect("Invalid date")
.and_hms_opt(0, 0, 0)
.expect("Invalid time")
.and_utc();
.expect("Invalid date");
worker
.fetch_within(start, end)