aboutsummaryrefslogtreecommitdiff
path: root/functions/__mark_new_store.fish
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2016-02-17 18:35:11 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2016-02-17 18:35:11 +0100
commit9ce7f2b6e737980cee99603253c118a6603e3e86 (patch)
treed6a2eac00fa101860be4d370fcefc73784053f06 /functions/__mark_new_store.fish
parent6a3187cad73803833c27de2457edcfe43ff3351a (diff)
downloadmark-9ce7f2b6e737980cee99603253c118a6603e3e86.tar.gz
mark-9ce7f2b6e737980cee99603253c118a6603e3e86.zip
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.
Diffstat (limited to 'functions/__mark_new_store.fish')
-rw-r--r--functions/__mark_new_store.fish18
1 files changed, 16 insertions, 2 deletions
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