dates-str

Crates.iodates-str
lib.rsdates-str
version
sourcesrc
created_at2022-12-29 00:30:09.462665
updated_at2025-02-01 20:46:27.318562
descriptionA minimal date formatting library. For if you don't need any fancy stuff.
homepage
repositoryhttps://github.com/pswsm/dates-str/
max_upload_size
id747065
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(pswsm)

documentation

README

dates-str

A small string date library written in Rust, for Rust


NOTE: DateStr subtraction and add work weird, since it's assumed all months have 30 days, so use them carefully

An easy crate for using and formatting dates. Works with ISO-8601 formatted dates by default, but you can format your dates with a custom formatter.

Main

The main struct of this crate is the DateStr struct. By default and as of now, it only accepts a date in ISO-8601 format. In the near future you will be able to pass any date formatted however you like, as long as you provide a DateFormat.

The DateFormat struct is responsible for parsing dates when they are in non-ISO fromat. Only works for output at the moment.


TODO:

  • Date from custom format.
  • Check if month has correct day number. For example a date not beig the 31st of February
  • Better implementations of Add and Sub traits for DateStr (It works, but with assumptions)
  • Better README
  • Implement unix epoch, maybe from std::time

docs.rs || crates.io

Commit count: 37

cargo fmt