Created
June 10, 2018 07:24
-
-
Save rodoabad/4b975d269ee291db3b8dd03fc85b6899 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const findApplicableSplitsAgainstDividendYear = (dividendYear, splits) => { | |
| const formattedDividendYear = Number(moment(dividendYear).format('X')); | |
| return splits.reduce((acc, split) => { | |
| const formattedExDate = Number(moment(split.exDate).format('X')); | |
| return formattedExDate > formattedDividendYear ? | |
| [ | |
| ...acc, | |
| split.ratio | |
| ] : | |
| acc; | |
| }, []); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment