summaryrefslogtreecommitdiffstats
path: root/_includes/dayofweek.html
diff options
context:
space:
mode:
authorsijanec <sijanecantonluka@gmail.com>2020-11-07 23:43:49 +0100
committersijanec <sijanecantonluka@gmail.com>2020-11-07 23:43:49 +0100
commited8911963ad821f4afecc52c8501e2d8f7bf10c1 (patch)
tree7241207ffd45b2796478b05656e6a71458aa0293 /_includes/dayofweek.html
parentdodal tekst ko je stran urejena (diff)
downloadsijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.gz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.bz2
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.lz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.xz
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.tar.zst
sijanec.eu-ed8911963ad821f4afecc52c8501e2d8f7bf10c1.zip
Diffstat (limited to '')
-rw-r--r--_includes/dayofweek.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/_includes/dayofweek.html b/_includes/dayofweek.html
new file mode 100644
index 0000000..41dd2e4
--- /dev/null
+++ b/_includes/dayofweek.html
@@ -0,0 +1,21 @@
+{% comment %}
+ argv: datestring
+ return: day in week (1: monday)
+{% endcomment %}
+{% assign dayinweek_datearr = argv[0] | split: " " %}
+{% assign dayinweek_datearr = dayinweek_datearr | split: "-" %}
+{% assign dayinweek_magic = "032503514624" | split: "" %}
+{% assign dayinweek_mesec = dayinweek_datearr[1] | plus: 0 %}
+{% assign dayinweek_day = dayinweek_datearr[2] | plus: 0 %}
+{% assign dayinweek_magicselector = dayinweek_mesec | minus: 1 %}
+{% if dayinweek_mesec < 3 %}
+ {% assign dayofweek_leto = argv[0] | minus: 1 %}
+{% else %}
+ {% assign dayofweek_leto = argv[0] | plus: 0 %}
+{% endif %}
+{% assign return = dayofweek_leto | divided_by: 4 | plus: dayofweek_leto | plus: dayinweek_day | plus: dayinweek_magic[dayinweek_magicselector] %}
+{% assign dayofweek_leto_div = dayofweek_leto | divided_by: 100 %}
+{% assign return = return | minus: dayofweek_leto_div %}
+{% assign dayofweek_leto_div = dayofweek_leto | divided_by: 400 %}
+{% assign return = return | plus: dayofweek_leto_div %}
+{% assign return = return | modulo: 7 %}