|
@ -294,10 +294,10 @@ export class PortfolioService { |
|
|
|
|
|
|
|
|
// Add investment of current group
|
|
|
// Add investment of current group
|
|
|
const dateOfCurrentGroup = format( |
|
|
const dateOfCurrentGroup = format( |
|
|
set( |
|
|
set(new Date(), { |
|
|
new Date(), |
|
|
date: 1, |
|
|
groupBy === 'month' ? { date: 1 } : { date: 1, month: 1 } |
|
|
month: groupBy === 'year' ? 0 : new Date().getMonth() |
|
|
), |
|
|
}), |
|
|
DATE_FORMAT |
|
|
DATE_FORMAT |
|
|
); |
|
|
); |
|
|
const investmentOfCurrentGroup = investments.filter(({ date }) => { |
|
|
const investmentOfCurrentGroup = investments.filter(({ date }) => { |
|
@ -1296,10 +1296,10 @@ export class PortfolioService { |
|
|
if (currentDate) { |
|
|
if (currentDate) { |
|
|
dividends.push({ |
|
|
dividends.push({ |
|
|
date: format( |
|
|
date: format( |
|
|
set( |
|
|
set(currentDate, { |
|
|
currentDate, |
|
|
date: 1, |
|
|
groupBy === 'month' ? { date: 1 } : { date: 1, month: 1 } |
|
|
month: groupBy === 'year' ? 0 : currentDate.getMonth() |
|
|
), |
|
|
}), |
|
|
DATE_FORMAT |
|
|
DATE_FORMAT |
|
|
), |
|
|
), |
|
|
investment: investmentByGroup |
|
|
investment: investmentByGroup |
|
@ -1314,10 +1314,10 @@ export class PortfolioService { |
|
|
// Store current month (latest order)
|
|
|
// Store current month (latest order)
|
|
|
dividends.push({ |
|
|
dividends.push({ |
|
|
date: format( |
|
|
date: format( |
|
|
set( |
|
|
set(currentDate, { |
|
|
currentDate, |
|
|
date: 1, |
|
|
groupBy === 'month' ? { date: 1 } : { date: 1, month: 1 } |
|
|
month: groupBy === 'year' ? 0 : currentDate.getMonth() |
|
|
), |
|
|
}), |
|
|
DATE_FORMAT |
|
|
DATE_FORMAT |
|
|
), |
|
|
), |
|
|
investment: investmentByGroup |
|
|
investment: investmentByGroup |
|
|