From dcf8868773491c66c4527fe768ceacef38cf0e16 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Tue, 27 Jun 2017 17:34:55 +0200 Subject: Refs #3595: Fix coffeescript map not being compliant Signed-off-by: Thomas Shawarma Haddad --- app/assets/javascripts/smart_date.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/smart_date.coffee b/app/assets/javascripts/smart_date.coffee index 901b7a545..d9228670d 100644 --- a/app/assets/javascripts/smart_date.coffee +++ b/app/assets/javascripts/smart_date.coffee @@ -4,16 +4,15 @@ smartDateSelectSelector = "#{smartDateSelector} select" legalDaysPerMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] correctDay = (dateValues) -> - [day, month, year] = dates + [day, month, year] = dateValues return day if legalDaysPerMonth[month-1] >= day return 29 if day == 29 && isLeapYear(year) legalDaysPerMonth[month-1] smartCorrectDate = -> allSelectors = $(@).parent().children('select') # N'a pas un sibbling('select', include_self = true) ? - console.log allSelectors - allVals = allSelectors.map (sel) -> parseInt($(sel).val()) - console.log allVals + allVals = allSelectors.map (index, sel) -> + parseInt($(sel).val()) correctedDay = correctDay allVals daySelector = allSelectors.first() $(daySelector).val(correctedDay) -- cgit v1.2.3