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

Added option to remove creation date from tasks #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ice_recur
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ EOS
opt :ignore_projects, %Q{By default, projects ("+foo") are counted as part of the text when deciding if ice_recur is about to add a duplicate entry, so "new entry" would be added even if "new entry +foo" already exists. If you use this flag, those two will be considered the same entry and so it wouldn't be added.}, :short => :p
opt :ignore_contexts, %Q{By default, contexts ("@foo") are counted as part of the text when deciding if ice_recur is about to add a duplicate entry, so "new entry" would be added even if "new entry @foo" already exists. If you use this flag, those two will be considered the same entry and so it wouldn't be added.}, :short => :o
opt :force, %Q{Run even if we appear to have already run today.}
opt :no_creation_date, "Remove creation date before adding the task.", :short => :d
end

# Probably should have just used a parser library :P
Expand Down Expand Up @@ -495,8 +496,11 @@ else

# Pull the priority in front of the date
taskstr = taskstr.gsub(%r{^\s*([xX]\s*)?(\([A-Z]\)\s*)?}, '')
task = "#{$1}#{$2}#{cur_day.to_s} #{taskstr}\n"

if $opts[:no_creation_date]
task = "#{$1}#{$2}#{taskstr}\n"
else
task = "#{$1}#{$2}#{cur_day.to_s} #{taskstr}\n"
end
todo_list_new << task
todo_list_trimmed << [task_to_text(task), task]
end
Expand Down