mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
avoid selecting the day in the previous month
When you select date at the end of the month (27,28,29,30,...) it is likely possible that this date is already displayed by the calender but for the previous month. Avoid this by using css selector :not()
This commit is contained in:
@@ -10,7 +10,7 @@ module Features
|
||||
|
||||
def select_date_from_datepicker(date)
|
||||
navigate_datepicker_to_month date
|
||||
find('.flatpickr-calendar.open .flatpickr-days .flatpickr-day', text: date.strftime("%e").to_s.strip, exact_text: true, match: :first).click
|
||||
find('.flatpickr-calendar.open .flatpickr-days .flatpickr-day:not(.prevMonthDay)', text: date.strftime("%e").to_s.strip, exact_text: true, match: :first).click
|
||||
end
|
||||
|
||||
def navigate_datepicker_to_month(date, reference_date = Time.zone.today)
|
||||
|
||||
Reference in New Issue
Block a user