html-datetime-local

Crates.iohtml-datetime-local
lib.rshtml-datetime-local
version0.1.0
sourcesrc
created_at2023-12-18 16:23:02.172182
updated_at2023-12-18 16:23:02.172182
descriptionA Rust library for parsing local date and time strings based on the WHATWG HTML Living Standard. This may be helpful for server-side code that deals with values from input type=datetime-local
homepagehttps://github.com/tomsik68/html-datetime-local
repositoryhttps://github.com/tomsik68/html-datetime-local
max_upload_size
id1073486
size20,396
Tomáš Jašek (tomsik68)

documentation

README

html-datetime-local

html-datetime-local

GitHub license GitHub Workflow Status Crates.io Crates.io (latest)

Overview

html-datetime-local is a Rust library for parsing local date and time strings based on the WHATWG HTML Living Standard.

This may be helpful for server-side code that deals with values from <input type="datetime-local" />.

Usage

Add this to your Cargo.toml:

[dependencies]
html-datetime-local = "0.1"

Then, in your Rust code:

use html_datetime_local::Datetime;
use std::str::FromStr;

let input = "2023-12-31T23:59:59";
match Datetime::from_str(input) {
    Ok(datetime) => println!("Parsed datetime: {:?}", datetime),
    Err(err) => eprintln!("Error parsing datetime: {}", err),
}

Contributing

Pull requests and bug reports are welcome! If you have any questions or suggestions, feel free to open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Special thanks to ChatGPT, an AI language model by OpenAI, for providing invaluable assistance during the development of this project. ChatGPT helped with code suggestions, problem-solving, and provided guidance throughout the development process.

License: MIT

Commit count: 10

cargo fmt