Announcement

Collapse
No announcement yet.

[SOLVED] how to display calculated field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] how to display calculated field

    I have two dates fields start_date, end_date in editable grid. I created a new field "diff_date" in wich I would like to display the difference between the two dates fields.
    I create ajax event on end_date field on change I want to display the difference between these two dates .
    the code is :

    $current_date = date('Y-m-d');
    {diff_date} = sc_date_dif($current_date, 'aaaa-mm-dd', {end_date}, 'aaaa-mm-dd');

    the problem is that nothnig is displayed, I mean the diff_date is still blank

    please advise
    thanks in advance

  • #2
    Hello,

    In which event are you using this code? Also, have you tried to instead of use $curring_date as one of the macro parameters to use another field from your application?

    regards,
    Bernhard Bernsmann

    Comment


    • #3
      First Problem Solved.
      I used Onchange ajaxevent. I just recreate the field diff_date and everything is OK

      Thanks bartho for your interest

      Comment


      • #4
        Glad I could help!

        regards,
        Bernhard Bernsmann

        Comment

        Working...
        X