infor-design / enterprise

Enterprise-grade component library for the Infor Design System
https://design.infor.com
Apache License 2.0
134 stars 81 forks source link

Datepicker - Bug in setToday on islamic calendar #1189

Closed tmcconechy closed 5 years ago

tmcconechy commented 5 years ago

Describe the bug

As found on the failing build https://travis-ci.com/infor-design/enterprise/jobs/157254117#L2399 there is a bug in the setToday function of the calendar. It stems from https://github.com/infor-design/enterprise/blob/master/src/components/datepicker/datepicker.js#L1536 basically its not current to use a Date() type here and assume it will convert. We need to use arrays for islamic date because this is converting it back to Gregorian

To Reproduce Steps to reproduce the behavior:

  1. Has to be on a month with different number of days than the arabic calendar.
  2. Call $('#date-field-normal').data('datepicker').setToday()
  3. Notice the set date in the picker is wrong compared to https://www.staff.science.uu.nl/~gent0113/islam/ummalqura.htm
tmcconechy commented 5 years ago

To test this issue:

1) http://localhost:4000/components/datepicker/example-index.html?locale=ar-SA 2) click today (the button on the right). It should insert a date with 1440.

(Can verify against https://www.staff.science.uu.nl/~gent0113/islam/ummalqura_converter.htm)

CindyMercadoReyes commented 5 years ago

This issue is now resolved. Moving this ticket to the Done folder.