add current position calculation with holding period return calculation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Currency } from '@prisma/client';
|
||||
import { getDate, getMonth, getYear, subDays } from 'date-fns';
|
||||
import { getDate, getMonth, getYear, parse, subDays } from 'date-fns';
|
||||
|
||||
import { ghostfolioScraperApiSymbolPrefix } from './config';
|
||||
|
||||
@@ -137,3 +137,9 @@ export function resolveFearAndGreedIndex(aValue: number) {
|
||||
return { emoji: '🤪', text: 'Extreme Greed' };
|
||||
}
|
||||
}
|
||||
|
||||
export const DATE_FORMAT = 'yyyy-MM-dd';
|
||||
|
||||
export function parseDate(date: string) {
|
||||
return parse(date, DATE_FORMAT, new Date());
|
||||
}
|
||||
|
Reference in New Issue
Block a user