mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Merge branch 'main' into issue94
This commit is contained in:
commit
0308b7a4c7
3 changed files with 15 additions and 1 deletions
|
@ -33,6 +33,7 @@ The following keys, and key formats, are defined:
|
|||
* `start` - the most recent time at which this task was started (a task with no `start` key is not active)
|
||||
* `tag_<tag>` - indicates this task has tag `<tag>` (value is an empty string)
|
||||
* `wait` - indicates the time before which this task should be hidden, as it is not actionable
|
||||
* `entry` - the time at which the task was created
|
||||
* `annotation_<timestamp>` - value is an annotation created at the given time
|
||||
|
||||
The following are not yet implemented:
|
||||
|
|
|
@ -108,6 +108,7 @@ impl Replica {
|
|||
let mut task = self.create_task(uuid)?.into_mut(self);
|
||||
task.set_description(description)?;
|
||||
task.set_status(status)?;
|
||||
task.set_entry(Utc::now())?;
|
||||
trace!("task {} created", uuid);
|
||||
Ok(task.into_immut())
|
||||
}
|
||||
|
@ -238,7 +239,7 @@ mod tests {
|
|||
..
|
||||
} = op
|
||||
{
|
||||
if property == "modified" {
|
||||
if property == "modified" || property == "entry" {
|
||||
if value.is_some() {
|
||||
value = Some("just-now".into());
|
||||
}
|
||||
|
@ -287,6 +288,13 @@ mod tests {
|
|||
value: Some("pending".into()),
|
||||
timestamp: now,
|
||||
},
|
||||
ReplicaOp::Update {
|
||||
uuid: t.get_uuid(),
|
||||
property: "entry".into(),
|
||||
old_value: None,
|
||||
value: Some("just-now".into()),
|
||||
timestamp: now,
|
||||
},
|
||||
ReplicaOp::Update {
|
||||
uuid: t.get_uuid(),
|
||||
property: "modified".into(),
|
||||
|
|
|
@ -57,6 +57,7 @@ enum Prop {
|
|||
Start,
|
||||
Status,
|
||||
Wait,
|
||||
Entry,
|
||||
}
|
||||
|
||||
#[allow(clippy::ptr_arg)]
|
||||
|
@ -284,6 +285,10 @@ impl<'r> TaskMut<'r> {
|
|||
self.set_string(Prop::Description.as_ref(), Some(description))
|
||||
}
|
||||
|
||||
pub(crate) fn set_entry(&mut self, entry: DateTime<Utc>) -> anyhow::Result<()> {
|
||||
self.set_timestamp(Prop::Entry.as_ref(), Some(entry))
|
||||
}
|
||||
|
||||
pub fn set_wait(&mut self, wait: Option<DateTime<Utc>>) -> anyhow::Result<()> {
|
||||
self.set_timestamp(Prop::Wait.as_ref(), wait)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue