Permalink
Browse files

Added configuration value for DATE_ON_ADD; increased width of table v…

…iew; fixed formatting bug in list command when a todo doesn't have a date prefix;
  • Loading branch information...
hartez committed Apr 28, 2011
1 parent 968110a commit 2b1ec173855bc9bd37109a737d2b1fb84ee172d1
Showing with 18 additions and 7 deletions.
  1. +2 −2 todo.cs
  2. +8 −1 todo.ps1xml
  3. +7 −4 todo.psm1
  4. +1 −0 todo_cfg.ps1
View
@@ -172,8 +172,8 @@ public override String ToString()
return
(_completed ? "x " : String.Empty)
+ (!String.IsNullOrEmpty(Priority) ? "(" + Priority + ") " : String.Empty)
- + (Date.HasValue ? Date.Value.ToString("yyyy-MM-dd") : String.Empty)
- + " " + ToDoProjectContext;
+ + (Date.HasValue ? (Date.Value.ToString("yyyy-MM-dd") + " ") : String.Empty)
+ + ToDoProjectContext;
}
}
View
@@ -12,12 +12,16 @@
<TableColumnHeader>
<Label>Item</Label>
<Width>4</Width>
+ </TableColumnHeader>
+ <TableColumnHeader>
+ <Label>Done</Label>
+ <Width>5</Width>
</TableColumnHeader>
<TableColumnHeader>
<Width>8</Width>
</TableColumnHeader>
<TableColumnHeader>
- <Width>60</Width>
+ <Width>80</Width>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
@@ -26,6 +30,9 @@
<TableColumnItem>
<PropertyName>ItemNumber</PropertyName>
</TableColumnItem>
+ <TableColumnItem>
+ <PropertyName>Completed</PropertyName>
+ </TableColumnItem>
<TableColumnItem>
<PropertyName>Priority</PropertyName>
</TableColumnItem>
View
@@ -11,6 +11,7 @@ function LoadConfiguration() {
$script:TODOTXT_FORCE = $FALSE
$script:TODOTXT_AUTO_ARCHIVE = $FALSE
$script:TODOTXT_PRESERVE_LINE_NUMBERS = $FALSE
+ $script:TODOTXT_DATE_ON_ADD = $TRUE
## Override the defaults with the configuration file
if(Test-Path $path)
@@ -304,12 +305,14 @@ param(
[string[]] $item
)
- ## TODO - check configuration for whether to prepend the add date
- $now = (Get-Date -format "yyyy-MM-dd")
+ $item = ([String]::Join(" ", $item)).Trim()
- $item = [String]::Join(" ", $item)
+ if($TODOTXT_DATE_ON_ADD)
+ {
+ $item = ((Get-Date -format "yyyy-MM-dd") + " " + $item)
+ }
- Add-Content $TODO_FILE ($now + " " + $item)
+ Add-Content $TODO_FILE ($item)
if($TODOTXT_VERBOSE)
{
View
@@ -3,3 +3,4 @@ $script:TODOTXT_VERBOSE = $TRUE
$script:TODOTXT_FORCE = $FALSE
$script:TODOTXT_AUTO_ARCHIVE = $FALSE
$script:TODOTXT_PRESERVE_LINE_NUMBERS = $FALSE
+$script:TODOTXT_DATE_ON_ADD = $TRUE

0 comments on commit 2b1ec17

Please sign in to comment.