Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have two text boxes.One is for taking StartDate from a islamic calender,so i am using jQuery Calendars Datepicker. The ExpireDate textbox will automatically 60days from StartDate.so i am writing the logic in Onclose event of datepicker.
JavaScript
$(document).ready(function () {
    ShowCalender();
});
function ShowCalender() {
    var calendar = $.calendars.instance('islamic');
    $('[id$=TxtOrderDate]').calendarsPicker({
        calendar: calendar,
        onClose: function (dates) {
            var expiryDate = new Date(dates);
            var x = 60;
            expiryDate.setDate(expiryDate.getDate() + x);               
            document.getElementById('<%=TxtExpirationDate.ClientID%>').value = expiryDate;
        },
        showTrigger: '<img src="../../../_layouts/15/1033/Saudia/Images/calender.png" alt="Popup" class="trigger img">'

    });
}


ASM
but here the ExpireDate fill with Date Sun Apr 24 03:00:00 UTC+0300 1436,which is a gregorian date. expiredate mustbe the islamic Date.

How to add specific number of Days in FromDate? Please help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900