Date picker Select Value

You have the button1_click(event, $w) and date_diff_indays(date1, date2) functions inside of the onReady() function which is why you are getting a syntax error. You need to move both of these function outside of the onReady() function.

You should use my example code as a model for what you need to do.

It’s not clear to me what your logic is supposed to be, but in order to progress you need to fix the above problem.