Skip to content
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

Add ability to mention due date in human-friendly format #11

Open
DarthBenro008 opened this issue Jul 31, 2021 · 0 comments
Open

Add ability to mention due date in human-friendly format #11

DarthBenro008 opened this issue Jul 31, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DarthBenro008
Copy link
Owner

Currently rChore does not accept due date for tasks

image

Feature:

It would be nice if we could take in due date in human friendly date format

Relevant Codebase:

pub fn add_task(&self) -> anyhow::Result<()> {
let title: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Title of the task")
.with_initial_text("task")
.allow_empty(false)
.interact_text()?;
let notes: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Note for task")
.with_initial_text("note")
.allow_empty(true)
.interact_text()?;
let items = vec!["No", "Yes"];
let completed = Select::with_theme(&ColorfulTheme::default())
.with_prompt("Is the task completed?")
.items(&items)
.default(0)
.interact_on_opt(&Term::stderr())?
.unwrap();
let status = if completed == 0 {
String::from("needsAction")
} else {
String::from("completed")
};
let task = Tasks::new(None, title, notes, status);
let resp = &self.client.add_task(task);
match resp {
Ok(task) => {
let _ = self.client.localdb.add_task(task.clone());
print_success(format!("Task {} has been created!", task.title))
}
Err(err) => print_error("creating task", err),
}
Ok(())
}

@DarthBenro008 DarthBenro008 added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 31, 2021
Tch3renk0v pushed a commit to Tch3renk0v/rchore that referenced this issue Aug 28, 2022
- created a simple Datetime selector in the task add method
- Set the initial date field to today date
- Handled the Timezone offset based on local date
- Prepared time implementation (google api doesn't support it yet)
Tch3renk0v added a commit to Tch3renk0v/rchore that referenced this issue Aug 28, 2022
- created a simple Datetime selector in the task add method
- Set the initial date field to today date
- Handled the Timezone offset based on local date
- Prepared time implementation (google api doesn't support it yet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant