From 1e7a5415289ed31e217b5d68ed81a352c0e055c9 Mon Sep 17 00:00:00 2001 From: yuankunzhang Date: Thu, 24 Jul 2025 14:13:01 +0000 Subject: [PATCH] docs: update readme --- README.md | 3 +-- src/items/builder.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a0e0df..7e7c022 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A Rust crate for parsing human-readable relative time strings and human-readable - Parses a variety of human-readable and standard time formats. - Supports positive and negative durations. -- Allows for chaining time units (e.g., "1 hour 2 minutes" or "2 days and 2 hours"). +- Allows for chaining time units (e.g., "1 hour 2 minutes" or "2 days 2 hours ago"). - Calculate durations relative to a specified date. - Relies on Chrono @@ -58,7 +58,6 @@ The `parse_datetime` and `parse_datetime_at_date` functions support absolute dat - "tomorrow" - use "ago" for the past - use "next" or "last" with `unit` (e.g., "next week", "last year") -- combined units with "and" or "," (e.g., "2 years and 1 month", "1 day, 2 hours" or "2 weeks 1 second") - unix timestamps (for example "@0" "@1344000") `num` can be a positive or negative integer. diff --git a/src/items/builder.rs b/src/items/builder.rs index 9fb76ef..3543bda 100644 --- a/src/items/builder.rs +++ b/src/items/builder.rs @@ -233,6 +233,7 @@ impl DateTimeBuilder { } for rel in self.relative { + // TODO: Handle potential overflows in the addition operations. match rel { relative::Relative::Years(x) => { dt = dt.with_year(dt.year() + x)?;