Board Thread:Support Requests - Getting Technical/@comment-28941090-20180223005030/@comment-9605025-20180223045816

Wow! So much to cover. I'll update this post once I finish sorting through all your templates. - Update:

Do you have a page where you are trying to test it? I am not sure what you mean when you say you tried to put "df" instead of "mf"; I don't see "mf" anywhere. Also, where did you get this template (and the associated templates)? There are a few things that just don't make any sense to me about the way it is structured.

Birth_date_and_age
What is the purpose of having a parameter as the default to its own default?

In quite a few places, you have something such as. The way this works is that it will use parameter 3 unless it is not specified. In the case that it isn't specified, it will use parameter "day"; unless "day" isn't specified. In which case it will use parameter 3; which we already know also has not been specified, so it will instead literally use "".

I also do not understand the purpose of the span element with the "bday" class. This element will never be visible because its parent span element is not displayed.

It looks like a lot of the markup you have, including the MONTHNAME and MONTHNUMBER templates, is simply to format the date. In which case, I encourage you to consider using either #time or #dateformat instead.

MONTHNAME
I think your switch statement won't work the way you want it to. It appears that you are attempting to have "Incorrect required parameter 1=month!" display if template MONTHNUMBER does not supply a number between 1 and 12. However, the switch statement has a special meaning for "=". What will actually happen is that it will display "month!" if template MONTHNUMBER supplies "Incorrect required parameter 1"; which it never will since you have not set it to do so. In order to correct this, you need to explicitly identify the default using "#default". For example:

It seems to me that you use template MONTHNUMBER to translate from either the English word, the English abbreviation, or a number to the integer representation. Then, you use this template to translate the integer representation into the Greek word. However, why not just do that directly in this template?

MONTHNUMBER
It appears that the purpose of this template is to translate from either the English word, the English abbreviation, or a number to the integer representation. If that is indeed the case, why is the 12th month written in Greek? Also, it is not a good idea to have the number conversion as the default output of the switch statement comparing names and abbreviations. The reason is that #expr and #ifexpr will give an error message if the input is not a number. For example, if I input "A", it will not match any of your cases and thus proceed to use the switch statement's default. When it does this #ifexpr will attempt to evalauate whether or not "A" is less than "0". Since "A" is not a number, it will produce an error message; specifically "". What you should do is use #iferror. Also, consider using floor instead of the complicated addition/subtraction and rounding technique you currently use for rounding towards negative infinity. For example:

Also, since you only use  in the case of negative integer values, it is equivalent to.

age
If I understand your template correctly, you need an additional pair of paranthesis to group the "and" so that it is evalauated before the "or".