The first one is that variables are case sensitive. You are using “BoekjaarIsKalenderjaar” with a capital B to define your variable but “boekjaarIsKalenderjaar” without a capital b when you make a check on it with your if statement.
BoekjaarIsKalenderjaar != boekjaarIsKalenderjaar
The second problem is that you are using spaces in your capture. Boekjaar is defined as " 31/12 " in your capture and your if statement is checking for “31/12”. These spaces do make a difference.
" 31/12 " != “31/12”
Try adjusting your code with previous tips and let us know if it worked.
Het probleem ligt deze keer aan het gebruik van de quotes, je kan zowel enkele als dubbele gebruiken maar bij de enkele quotes zijn er 2 verschillende namelijk ` en ’
Enkel de tweede soort kan werken. Je kan ook zoals in onderstaand voorbeeld dubbele quotes gebruiken.
{% comment %} Bedrag is per AJ (AJ 2017 → inkomsten 2016) {% endcomment %}
{% assign intrest_2017 = 0.2018 %}
{% assign intrest_2017 = 0.0927 %}
{% assign intrest_2016 = 0.0816 %}
{% assign intrest_2015 = 0.0920 %}
At the place i want the date I just then put {{ date }}
This works, but the problem I’m facing now, is that he takes all the dates from the first line in the whole template.
I have multiple dates in multiple lines, so every outcome 1d + 5Y has to be different.
{% input custom.some.date as:date %}
{% assign original_date = custom.some.date | date:'%s' %}
seconds since 1970-01-01 00:00:00 UTC = {{ original_date }}
{% assign 5_years_1_day = 157871030 %}
{% assign new_date = original_date | plus:5_years_1_day %}
test new date = {{ new_date | date:"%d/%m/%Y" }}
The %s show a date in the amount of seconds from the date of 1/1/1970.
The variable 5_years_1_day is what I created to add the amount of seconds that equals 5 years and 1 day.
I’ll add this to my original date and add a date filter on it to display the correct date-format.
There are other ways to play with dates though, but does this by any chance solves your issue? Not quite sure if I understood your issue by your posted code
I have following code. If I give in my date, I want the date in {{date}} to be calculated 5Y + 1d.
With current code I get always the same date. If I use a second line with another date, the date has to be different of course. Could you help me out ?
Your whole logic around that date, should be done within your fori-loop. It makes sense to do so, because for each loop a new date has to be calculated.
Because you did this outside the fori-loop in the beginning, the variable {{ date }} will indeed give the same result, no matter what loop you’re in.
Care to give it a try? Let me know if you’re stuck with my explanation
Within your fori-loop, after you generate your custom input-date. Like this for example (I added stripnewlines so you’ll see it better - see here for more info if needed) :
Be aware that I changed your custom objects into detail.custom everywhere! Because your are putting in custom objects into a drop that is ours (the details-drop) so if you want to write down custom objects in there, you need to use .custom .
One little suggestion: your code will always generate a date, even a date hasn’t been inputted. So I’d suggest putting that whole logic code into an if-statement (check if the input-date is blank or not), so you won’t see a wierd date generated while no input has been made.