Scenario 1: When I select input date Day: 1 Month: March Year: 1996

Expected result = 01/03/1996 Sample for Calendar After selecting the date from the Calendar

Scenario 2: When I select input date - 31/12/1995 from the January Calendar of year 1996 Day: 31 Month: December Year: If I leave year default as 1996 as per previous case it should consider as 1995 because as per the below screenshot.

Expected result: 31/12/1995 But receiving 31/12/1996 Calendar for JANUARY 1996 After selecting Date 31 from the JANUARY Calendar of 1996

  • 2
    This looks like an issue that could be reported on Appiphony's GitHub. I'm not sure it has an answer to provide as such. – David Reed Sep 14 at 13:11
  • Thanks, @DavidReed and yes sure will be reporting. – SHAAN Sep 14 at 13:14
up vote 0 down vote accepted

I found the solution of this past week posting it late.

SOLUTION- We have Jquery file named as jquery.aljs-datepicker.In which you need to add logic for the previous year by just making the year variable -1 on selection of date 25 to 31 from the January month.

Steps:

  1. We need to find the source of the formation of the date, which is forming the calendar rows.
  2. Then we need to get the data of row[0] only of the month January, out of the calendar rows.
  3. Then we set up a variable which will hold the date selected, and set the condition for the date selection (As we know that there can be maximum of 24 to 31 date of the previous month so, we kept the condition on that) Screenshot attached in the question Scenario 1

    var selectedDate = some date;

    if(selectedDate >= 25 && selectedDate <= 31 && month = january)

    Then we need to subtract the year by 1.

    Will be posting the code soon.

    Thanks!

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.