diff --git a/README.md b/README.md index ae673a9..c6027bc 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ RustyTUICalendar is a terminal-based calendar application written in Rust. It le ## Features - Display a monthly calendar starting from Sunday -- Add, edit, and delete events +- Add and delete events - Highlight current date -- Add, edit and delete To-Do list +- Add and delete To-Do list - User-friendly terminal interface ## Installation @@ -17,22 +17,41 @@ To install RustyTUICalendar, you need to have Rust and Cargo installed on your s Clone the repository: ```sh -git clone https://github.com/soumyasen1809/RustyTUICalendar.git -cd RustyTUICalendar +$ git clone https://github.com/soumyasen1809/RustyTUICalendar.git +$ cd RustyTUICalendar ``` Build the project: ```sh -cargo build --release +$ cargo build --release ``` Run the application: ```sh -cargo run +$ cargo run ``` +## Features +Press F3 to start typing your commands. + +- **Add Events to ToDo or Calendar**: If the input specifies `todo`, it adds the event to the ToDo list. If the input specifies `app`, it adds the appointment to the calendar. +```sh +$ app, 2024-09-14 13:14:50, Appointment Title, Appointment Location +$ todo, true, Todo Title +``` +- **Search for an Appointment**: If the input specifies `search`, it searches for the appointment in the calendar for the given date. +```sh +$ find, 2024-09-14 +``` +- **Jump to Today**: If the input specifies `today`, it sets the calendar date to the current date. +```sh +$ today +``` + +Additionally, press F1 and F2 to move to previous and next months respectively. + ## Contributing Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. diff --git a/assets/appointments.json b/assets/appointments.json index 324286c..1b69918 100644 --- a/assets/appointments.json +++ b/assets/appointments.json @@ -37,12 +37,12 @@ "location": "Lounge C" }, { - "date": "2024-09-08 15:00:00", + "date": "2024-09-09 15:00:00", "event_name": "Old Team Meeting", "location": "Online: https://teams.microsoft.com/l/meetup-join/19%3ameeting_NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2%40thread.v2/0?context=%7b%22Tid%22%3a%22your-tenant-id%22%2c%22Oid%22%3a%22your-object-id%22%7d" }, { - "date": "2024-09-08 07:09:34", + "date": "2024-09-09 07:09:34", "event_name": "Have a demo ready", "location": "Library" } diff --git a/src/to_do_widget.rs b/src/to_do_widget.rs index 2519cf7..255b474 100644 --- a/src/to_do_widget.rs +++ b/src/to_do_widget.rs @@ -75,7 +75,9 @@ fn write_user_input_to_json( } } else if parts_input.len() == 2 { // Search for an appointment - if parts_input[0].trim().to_lowercase().contains("find") { + if (parts_input[0].trim().to_lowercase().contains("find")) + || parts_input[0].trim().to_lowercase().contains("search") + { if parts_input[1].clone().len() < 19 { // If less than 19, then it is in NaiveDate format => need to change it to NaiveDateTime let date_time_formated =