Skip to content
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
14 changes: 11 additions & 3 deletions view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function date_view() {
option=$1

# Get today
today=$(date -d $(date +%Y-%m-%d) +%s)
today=$(gdate -d $(gdate +%Y-%m-%d) +%s)

# For each date show header and the list of todo items
for date in $DATES ; do
Expand Down Expand Up @@ -150,7 +150,7 @@ function date_check() {
# Assign variables
threshold=$1
today=$2
_date=$(date -d "$3" +%s)
_date=$(gdate -d "$3" +%s)

# Check if the date is valid or not
# return:
Expand Down Expand Up @@ -193,6 +193,14 @@ function date_check() {
return 0
}

[ "$action" = "usage" ] && {
echo " View todos:"
echo " view"
echo " Groups and outputs tasks by various dimensions like projects, contextes, etc."
echo ""
exit
}

# Validate the input options
re="^(help|project|context|date|nodate|future|past|today|tomorrow|yesterday|([+-][0-9]+|[0-9]+)(days|weeks|months|years))$"
if [[ "$option" =~ $re ]]; then
Expand All @@ -209,7 +217,7 @@ if [[ "$option" =~ $re ]]; then
*)
re="^(date|nodate|future|past)$"
if [[ ! ( "$option" =~ $re ) ]]; then
option=$(date -d $(date -d $option +%Y-%m-%d) +%s)
option=$(gdate -d $(gdate -d $option +%Y-%m-%d) +%s)
fi

date_view $option
Expand Down