How to add Days in Islamic or HijriDate?

I have two text boxes. One for taking StartDate from Islamic calendar, so I am using jQuery Calendars Datepicker. The ExpireDate text box will be automatically 60 days from StartDate . So I write the logic in the Onclose event of the datepicker.

$(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">'

    });
}

      

but here the ExpireDate value is filled with the date Sun Apr 24 03:00:00 UTC + 0300 1436 which is the gregorian date. expiredate must be an Islamic date.

How do I add a specific number of days to FromDate? Please, help.

+3


source to share


1 answer


I think you have to do date operations (add date) in Gregorian format and then format back to Islamic date. keith-wood.name/calendars



+1


source







All Articles