age_script

NAML documentation   Watch a video
   Usages of this macro
The source code below doesn't have navigation links because no usage has been compiled yet. Navigation links depend on how and where the macro is used, so first you may try finding all usages of "age_script".
... in extra_fields.naml
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<macro name="age_script">
    <script type="text/javascript">
        
        function age_fill(bday){
          var d =bday.split("\/");        
          var d1 = new Date(d[2],parseInt(d[0])-1, d[1]);
          var d2 =new Date();         
        
          var milli= d2 - d1;
          var milliPerYear=1000*60*60*24*365.26;
        
          var yearsApart=milli/milliPerYear;        
          var age = Math.floor(yearsApart);        
          $("span.age").text(age);        
        }
        
        $( document ).ready(function() {
          if( $("#extra_fields_form").length == 0){
            age_fill('<n.this_user.get_property name="bday"/>');
          }       
        });
    </script>
</macro>