aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Haddad2017-06-27 17:34:55 +0200
committerThomas Haddad2017-06-27 17:34:55 +0200
commitdcf8868773491c66c4527fe768ceacef38cf0e16 (patch)
tree2defb2d11b793c367525ccace172b0635ec6ee21
parent0a147aec1d594884478e9d7006941e7ab5167bec (diff)
downloadchouette-core-dcf8868773491c66c4527fe768ceacef38cf0e16.tar.bz2
Refs #3595: Fix coffeescript map not being compliant
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
-rw-r--r--app/assets/javascripts/smart_date.coffee7
1 files changed, 3 insertions, 4 deletions
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)