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

Friday 13th #159

Open
lazyandproud opened this issue Jan 29, 2024 · 1 comment
Open

Friday 13th #159

lazyandproud opened this issue Jan 29, 2024 · 1 comment

Comments

@lazyandproud
Copy link

Is it possible to create a recurring entry for the next Friday 13th?

@TheFes
Copy link

TheFes commented Oct 1, 2024

Here is a template which will give you the next Friday the 13th

{% set start = now().date().replace(day=13) %}
{% set start = (start + timedelta(days=30)).replace(day=13) if start < now().date() else start %}
{% set ns = namespace(friday_13th=start) %}
{% for i in range(50) %}
  {% if ns.friday_13th.weekday() == 4 %}
    {% break %}
  {% endif %}
  {% set ns.friday_13th = (ns.friday_13th + timedelta(days=30)).replace(day=13) %}
{% endfor %}
{{ ns.friday_13th }}

Apparently the next one is December

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants