From 9ce7f2b6e737980cee99603253c118a6603e3e86 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 17 Feb 2016 18:35:11 +0100 Subject: change #store# layout Now every month has the correct amount of marks not always 31. This change should not affect set and print_month because they never use a fixed assumption how many marks/days a month has. --- functions/__mark_new_store.fish | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'functions/__mark_new_store.fish') diff --git a/functions/__mark_new_store.fish b/functions/__mark_new_store.fish index 5cd411d..06dd2de 100644 --- a/functions/__mark_new_store.fish +++ b/functions/__mark_new_store.fish @@ -1,10 +1,24 @@ function __mark_new_store --description "generates new mark store for one year" + set year (date "+%Y") echo "#colors#" echo "#store#" - echo (date "+%Y"): + echo $year: for m in (seq 1 12) echo -n "$m:" - for d in (seq 1 31) + switch $m + case 1 3 5 7 8 10 12 + set days 31 + case 4 6 9 11 + set days 30 + case 2 + if date -d "$year-02-29" >/dev/null ^/dev/null + set days 29 + else + set days 28 + end + end + + for d in (seq 1 $days) echo -n "?" end echo -- cgit v1.2.3