Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uutils/parse_datetime
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.0
Choose a base ref
...
head repository: uutils/parse_datetime
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.8.0
Choose a head ref

Commits on Jan 18, 2025

  1. Parse datetimes with single digit timezone offset

    Parse full datetimes with single digit timezone offsets like +3 or -5.
    jfinkels committed Jan 18, 2025
    Copy the full SHA
    ea49dc9 View commit details

Commits on Jan 19, 2025

  1. Merge pull request #102 from jfinkels/parse-datetime-with-single-digi…

    …t-offset
    
    Parse datetimes with single digit timezone offset
    sylvestre authored Jan 19, 2025
    Copy the full SHA
    a7061bc View commit details
  2. prepare new release 0.7.0

    sylvestre committed Jan 19, 2025
    Copy the full SHA
    9cd22af View commit details
  3. Merge pull request #105 from sylvestre/0.7.0

    prepare new release 0.7.0
    sylvestre authored Jan 19, 2025
    Copy the full SHA
    b209341 View commit details
  4. Parse datetime with T separator and digit offset

    Parse a datetime with T separator between date and time, single digit
    timezone offset, and no space between time and offset.
    jfinkels committed Jan 19, 2025
    Copy the full SHA
    c948274 View commit details
  5. Merge pull request #103 from jfinkels/parse-datetime-with-single-digi…

    …t-offset-t-sep
    
    Parse datetime with T separator and single digit offset
    sylvestre authored Jan 19, 2025
    Copy the full SHA
    eda2422 View commit details

Commits on Jan 27, 2025

  1. Copy the full SHA
    94d4112 View commit details
  2. Copy the full SHA
    2fe83ca View commit details
  3. Merge pull request #107 from cakebaker/bump_nom

    Bump `nom` & adapt to API changes
    sylvestre authored Jan 27, 2025
    Copy the full SHA
    57fe123 View commit details

Commits on Jan 28, 2025

  1. Copy the full SHA
    0318dab View commit details

Commits on Jan 29, 2025

  1. Merge pull request #109 from uutils/renovate/libfuzzer-sys-0.x-lockfile

    fix(deps): update rust crate libfuzzer-sys to v0.4.9
    cakebaker authored Jan 29, 2025
    Copy the full SHA
    073b9f7 View commit details

Commits on Feb 8, 2025

  1. Make tests of adding months more resilient

    Protect against a situation where adding one month to the current day
    would cause an overflow in the next month in some unit tests of
    `parse_relative_time`. For example, adding one month to March 31
    should overflow to May 1 because April only has 30 days. This is a
    difference in the behavior we want for our library compared with the
    behavior of `chrono`.
    jfinkels committed Feb 8, 2025
    Copy the full SHA
    8dd8051 View commit details
  2. Copy the full SHA
    5c0c9c4 View commit details
  3. Merge pull request #112 from jfinkels/fix-add-months-tests

    Make tests of adding months more resilient
    sylvestre authored Feb 8, 2025
    Copy the full SHA
    7985aa0 View commit details
  4. Merge pull request #113 from jfinkels/set-utc-tz-in-test

    Explicitly set timezone UTC0 in a unit test
    sylvestre authored Feb 8, 2025
    Copy the full SHA
    51ddcb7 View commit details
  5. fuzz: remove rand dependency

    cakebaker authored and sylvestre committed Feb 8, 2025
    Copy the full SHA
    0965130 View commit details
  6. Allow empty string in parse_relative_time_at_date

    Allow the empty string when parsing the relative time in
    `parse_relative_time_at_date()`. The empty string represents zero time
    delta.
    jfinkels committed Feb 8, 2025
    Copy the full SHA
    45b9d9f View commit details

Commits on Feb 9, 2025

  1. Merge pull request #114 from jfinkels/parse-empty-string

    Allow empty string in parse_relative_time_at_date
    cakebaker authored Feb 9, 2025
    Copy the full SHA
    d0dceb6 View commit details
  2. Add passing test for parsing datetime ending in Z

    Add a passing unit test for parsing a datetime ending in the letter Z,
    as in
    
        2023-06-03 12:00:01Z
    
    This is treated as a datetime in the UTC time zone.
    jfinkels committed Feb 9, 2025
    Copy the full SHA
    f8adcb6 View commit details
  3. Greedy parsing of datetime before time delta

    Simulate greedy parsing of an absolute datetime in the prefix of a
    string before parsing a subsequent time delta in the suffix of the
    string. This does not change the behavior of `parse_datetime`, it just
    prepares the code for a future change that allows parsing both the
    absolute datetime and the time delta from the same string.
    
    Greedy parsing is implemented by iterating over a list of patterns in
    decreasing order of length so that longer patterns are tried before
    shorter patterns. This guarantees that if there is an absolute datetime
    present at the beginning of the string, then it will definitely be
    parsed and the remaining part of the string is assumed to contain a time
    delta.
    jfinkels committed Feb 9, 2025
    Copy the full SHA
    badc887 View commit details

Commits on Feb 12, 2025

  1. Avoid unnecessary slicing when parsing offset

    Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
    jfinkels and cakebaker authored Feb 12, 2025
    Copy the full SHA
    2c55db2 View commit details
  2. Merge pull request #115 from jfinkels/patterns-with-length

    Greedy parsing of datetime before time delta
    cakebaker authored Feb 12, 2025
    Copy the full SHA
    65c88f3 View commit details

Commits on Feb 13, 2025

  1. Copy the full SHA
    65cd15d View commit details
  2. Add a lot more unit tests

    Add more unit tests for `parse_datetime()` when given an input without
    a time delta (like "+1 year" or similar).
    jfinkels committed Feb 13, 2025
    Copy the full SHA
    3fcbac6 View commit details
  3. Merge pull request #118 from jfinkels/add-more-tests

    Add a lot more unit tests
    sylvestre authored Feb 13, 2025
    Copy the full SHA
    1daaeb4 View commit details
  4. Merge pull request #111 from cakebaker/fuzz_remove_rand_dependency

    fuzz: remove `rand` dependency
    sylvestre authored Feb 13, 2025
    Copy the full SHA
    63cfc01 View commit details
  5. Merge pull request #116 from jfinkels/remove-add-zero-months

    Remove more useless calls to add zero months to date
    sylvestre authored Feb 13, 2025
    Copy the full SHA
    c337aba View commit details
  6. Add time to parsed date after parsing not before

    Change the way dates without times are parsed by just parsing the date
    as-is and applying the placeholder time (00:00:00) after parsing
    instead of before.
    jfinkels committed Feb 13, 2025
    Copy the full SHA
    db18db4 View commit details

Commits on Feb 14, 2025

  1. Merge pull request #117 from jfinkels/add-time-to-date-after-parsing

    Add time to parsed date after parsing not before
    cakebaker authored Feb 14, 2025
    Copy the full SHA
    ca6a39c View commit details

Commits on Feb 15, 2025

  1. Copy the full SHA
    f1fada6 View commit details
  2. Parse reference date and delta from same string

    Change the `parse_datetime()` function so that it parses both a
    reference date and a time delta from one string. The new implementation
    attempts to parse the datetime from the longest possible prefix of the
    string. The remainder of the string is parsed as the time delta. This
    allows us to parse more combinations of reference dates and time deltas
    more easily.
    
    Fixes #104
    jfinkels committed Feb 15, 2025
    Copy the full SHA
    8aee979 View commit details

Commits on Feb 16, 2025

  1. Use str.ends_with for patterns ending in Z

    Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
    jfinkels and cakebaker authored Feb 16, 2025
    Copy the full SHA
    d4353d0 View commit details
  2. Merge pull request #110 from jfinkels/parse-ref-date-and-delta

    Parse reference datetime and timedelta from the same string
    cakebaker authored Feb 16, 2025
    Copy the full SHA
    e7a7a0b View commit details
  3. prepare 0.8.0

    sylvestre committed Feb 16, 2025
    Copy the full SHA
    93e1c9b View commit details
  4. fix clippy pedantic

    sylvestre committed Feb 16, 2025
    Copy the full SHA
    46cc414 View commit details

Commits on Feb 17, 2025

  1. Merge pull request #119 from sylvestre/new-release

    Prepare the new relase + clippy
    cakebaker authored Feb 17, 2025
    Copy the full SHA
    d4384ce View commit details
  2. Copy the full SHA
    52dca03 View commit details
Showing with 462 additions and 185 deletions.
  1. +3 −10 Cargo.lock
  2. +2 −2 Cargo.toml
  3. +2 −3 README.md
  4. +17 −70 fuzz/Cargo.lock
  5. +0 −1 fuzz/Cargo.toml
  6. +396 −68 src/lib.rs
  7. +27 −17 src/parse_relative_time.rs
  8. +4 −4 src/parse_time_only_str.rs
  9. +5 −5 src/parse_timestamp.rs
  10. +6 −5 src/parse_weekday.rs
13 changes: 3 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "parse_datetime"
description = "parsing human-readable time strings and converting them to a DateTime"
version = "0.6.0"
version = "0.8.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/uutils/parse_datetime"
@@ -10,4 +10,4 @@ readme = "README.md"
[dependencies]
regex = "1.10.4"
chrono = { version="0.4.38", default-features=false, features=["std", "alloc", "clock"] }
nom = "7.1.3"
nom = "8.0.0"
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -18,9 +18,8 @@ A Rust crate for parsing human-readable relative time strings and human-readable

Add this to your `Cargo.toml`:

```toml
[dependencies]
parse_datetime = "0.6.0"
```
cargo add parse_datetime
```

Then, import the crate and use the `parse_datetime_at_date` function:
87 changes: 17 additions & 70 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ edition = "2021"
cargo-fuzz = true

[dependencies]
rand = "0.8.5"
libfuzzer-sys = "0.4.7"
regex = "1.10.4"
chrono = { version="0.4", default-features=false, features=["std", "alloc", "clock"] }
Loading