Skip to content

formalize grammar of timestamp strings and use nom to parse them #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

yuankunzhang
Copy link
Contributor

@yuankunzhang yuankunzhang commented Apr 26, 2025

This PR is built on top of #132.

New feature: the parser now supports timestamp strings containing an internal decimal point (either '.' or ',').

BREAKING CHANGES: this commit introduced two breaking changes:

- Keyword `ago` semantic change (to be consistent with GNU date)

  The `ago` keyword now applies to individual date-time
  displacement (the one that immediately precedes it) and can
  be specified multiple times. For example, "1 day ago 2 days ago"
  gives a combined effect of "3 days ago", and "1 day 2 days ago"
  gives a combined effect of "1 day ago".

  In previous implementation, `ago` can only be specified once at
  the end of the relative time string, and it applies to all
  date-time displacements as a whole. So "1 day ago 2 days ago"
  is invalid and "1 day 2 days ago" gives a global effect of
  "3 days ago".

- Relative time strings like "lastweek" or "nextmonth" are now
  invalid, and space(s) are required in between the shift and the
  time unit.
New feature: the parser now supports timestamp strings containing
an internal decimal point (either '.' or ',').
Copy link

codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (b6795d9) to head (f759661).
Report is 2 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #133   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant