Title: [SOLVED] Adding days to datebox Post by: thecyberzone on March 11, 2019, 03:51:06 AM I have a easyui-datebox, say $('stdate') and another easyui-textbox $('days') contains number of days. After selecting any date from $('stdate') I want to add $('days') number of days and display the result into another easyui-datebox, say $('enddate').
Please help me. Title: Re: Adding days to datebox Post by: thecyberzone on March 11, 2019, 09:22:00 AM This is my code :
Code: $('#stdate').datebox({ Each time I put 03/20/2019 in #stdate and 3 as days/duration, result in #enddate always shows 09/19/2019, and this is wrong answer. I could not understand why this is happening. Please help. Title: Re: Adding days to datebox Post by: thecyberzone on March 11, 2019, 09:35:23 AM I have solved it, actually this line
dt.setDate(dt.getDate() + r.DURATION); should be writen as dt.setDate(parseInt(dt.getDate()) + parseInt(r.DURATION)); |