• Resolved klingbeil

    (@klingbeil)


    Hello
    I’m calculating the date of birth.
    It prints the result to the cell. But it does not write to the result section that comes with html.
    What could be the problem?

    (function(){
    var o = DATEDIFF(NOW(), fieldname19, 'dd-mm-yyyy', 'y');
    return o['years']+' Y?l'+ o['months']+' Ay'+ o['days']+' Gün';
    jQuery('#calculation-yashesaplama').html(yashesaplama);
    return yashesaplama;
    })()
    
    <span id="calculation-yashesaplama" style="color:#ff6504;"></span>

    Your age : [10] – [283 days until your new age] – [You were born on a Saturday.]

    How can we print like this?

    • This topic was modified 1 year, 7 months ago by klingbeil.
    • This topic was modified 1 year, 7 months ago by klingbeil.
Viewing 15 replies - 16 through 30 (of 34 total)
  • Thread Starter klingbeil

    (@klingbeil)

    Hello,
    I leave the live version of the calculation form. There are six links.
    Although we specify “id=”calculation-yearlykizinucrethakki”, it does not calculate. Actually, everything should calculate correctly, when A and B value criteria are removed, the calculation works.

    What could be the problem here? Actually everything was going well, thanks to you I am learning to use the plugin well..
    Thank you very much for supporting us for such a plugin.

    Push

    Y?ll?k ücretli ?zin Hakk? :

    <td style="text-align: left;"><b>Y?ll?k ücretli ?zin Hakk? :</b></td><td style="text-align: right;"><b><span id="calculation-yillikizinucrethakki" style="color:#ff6504;"></span></b></td>
    • This reply was modified 1 year, 7 months ago by klingbeil.
    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    The problem is simple. You can conditions like if (fieldname36 == 'A') and if (fieldname36 == 'B') but form 38 does not contains a fieldname36 field. You cannot use unexisting fields from the equations.

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    Could you please write the corrected version of the exams?

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    I assume you are trying to check the fieldname38. So, you must use it in the “if” conditional statements. if (fieldname38 == 'A')?and?if (fieldname38 == 'B')

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    i think i did it thank you very much

    • This reply was modified 1 year, 7 months ago by klingbeil.
    • This reply was modified 1 year, 7 months ago by klingbeil.
    Thread Starter klingbeil

    (@klingbeil)

    Example: When we select criterion (B) in Fieldname38..
    Is it possible to hide the Fieldname30 cell at the bottom?
    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    You simply should configure the fieldname30 as dependent on the choice “A” in the fieldname38.

    Learn more about dependencies between fields by reading the following blog post:

    https://cff.dwbooster.com/blog/2020/03/01/dependencies

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    You are amazing, thank you very much, excellent support. I gave your plugin 5 stars.

    Thread Starter klingbeil

    (@klingbeil)

    I am writing the result in the right fields with the result example calculation function. Criterion B is on the right side, I don’t want a cell to appear.

    Example : I selected fieldname30 and hide a cell in the 2nd query. Making a result that corresponds to the hidden cell #calculation-can I hide the hidden cell from the user?
    thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    I’ll try to describe the process with a hypothetical example.

    Assuming you have the equation:

    (function(){
    var result = fieldname1+fieldname2;
    jQuery('#show-result').html(result);
    return result;
    })()

    The equation above sums two fields, and displays the result in a tag with id="show-result" and the calculated field. But now, you have a dropdown field (fieldname3) with two choices: A and B, and you want to display the result in the tag only when the user selects the A choice, and leave the tag empty otherwise.

    To satisfy the new situation, you should use conditional statements as follows:

    (function(){
    var result = fieldname1+fieldname2;
    
    
    if(fieldname3 == 'A'){
      jQuery('#show-result').html(result);
    }
    
    else {
      jQuery('#show-result').html('');
    }
    
    return result;
    })()

    Or, using the IF operation

    (function(){
    var result = fieldname1+fieldname2;
    
    
    jQuery('#show-result').html(IF(fieldname3 == 'A', result, ''));
    
    return result;
    })()

    Best regards.

    How can I remove the time and timezone stamp from a calculated field? I need to sum 2 dates and output the date only in the calculated field. Here is the calculated field I am using.

    DATETIMESUM(‘today()’, ‘yyyy-mm-dd’, fieldname1, ‘d’)

    But it continues to return this format.

    Tue Aug 08 2023 09:54:24 GMT-0400 (Eastern Daylight Time)

    How can the time and time zone be removed from the output.

    Thank you.

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    Thank you very much for using our plugin.

    The DATETIMESUM operation returns a date object, so, you must use the GETDATETIMESTRING operation to transform it into a text with date format:

    GETDATETIMESTRING(DATETIMESUM(today(), 'yyyy-mm-dd', fieldname1, 'd'), 'yyyy-mm-dd')

    Note that today is an operation, you cannot enclose it between quotes.

    Best regards.

    Hello @codepeople

    Thank you for the quick response. I tried the getdatetimestring operation, and returns a blank field.

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    My apologies, I copied and pasted your code. Actually, Javascript is a case-sensitive language and the TODAY operation must be entered in uppercase. So, the correct equation is:

    GETDATETIMESTRING(DATETIMESUM(TODAY(), 'yyyy-mm-dd', fieldname1, 'd'), 'yyyy-mm-dd')

    Best regards.

    @codepeople

    No Worries! That worked! Once more question. is there a way to format the output for it to view in this format?

    Monday August 8 2023

    Currently it outputs yyyy-mm-dd, which is fine, but wanted to see if there is another output option. Thanks!

Viewing 15 replies - 16 through 30 (of 34 total)
  • The topic ‘Date Calculator’ is closed to new replies.