Skip to content

Commit 6bfc4b0

Browse files
committed
count months and days from 1 instead of 0
1 parent cdeba06 commit 6bfc4b0

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/commands/import.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,7 @@ pub(super) fn write_stats(meta: &Meta<'_>, vfs_path: &Path) -> anyhow::Result<()
217217
fn copy_stats(default_path: &Path, stats_path: &Path) -> anyhow::Result<()> {
218218
let today = chrono::Local::now().date_naive();
219219
#[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
220-
let today = (
221-
today.year() as u16,
222-
today.month0() as u8,
223-
today.day0() as u8,
224-
);
220+
let today = (today.year() as u16, today.month() as u8, today.day() as u8);
225221
let default = if default_path.exists() {
226222
let raw = fs::read(default_path).context("read default stats file")?;
227223
firefly_types::Stats::decode(&raw)?
@@ -265,11 +261,7 @@ fn update_stats(default_path: &Path, stats_path: &Path) -> anyhow::Result<()> {
265261

266262
let today = chrono::Local::now().date_naive();
267263
#[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
268-
let today = (
269-
today.year() as u16,
270-
today.month0() as u8,
271-
today.day0() as u8,
272-
);
264+
let today = (today.year() as u16, today.month() as u8, today.day() as u8);
273265
// The current date might be behind the current date on the device,
274266
// and it might be reflected in the dates recorded in the stats.
275267
// If that happens, try to stay closer to the device time.

0 commit comments

Comments
 (0)