mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
add trend in income and expense card in overview page
This commit is contained in:
@@ -133,6 +133,11 @@ export function getDayOfWeekName(date) {
|
||||
return dateTimeConstants.allWeekDaysArray[dayOfWeek].name;
|
||||
}
|
||||
|
||||
export function getMonthName(date) {
|
||||
const dayOfWeek = moment(date).month();
|
||||
return dateTimeConstants.allMonthsArray[dayOfWeek];
|
||||
}
|
||||
|
||||
export function getHour(date) {
|
||||
return moment(date).hour();
|
||||
}
|
||||
|
||||
+21
-1
@@ -258,7 +258,7 @@ export default {
|
||||
|
||||
return axios.get('v1/transactions/statistics.json' + (queryParams.length ? '?' + queryParams.join('&') : ''));
|
||||
},
|
||||
getTransactionAmounts: ({ today, thisWeek, thisMonth, thisYear }) => {
|
||||
getTransactionAmounts: ({ today, thisWeek, thisMonth, thisYear, lastMonth, monthBeforeLastMonth, monthBeforeLast2Months, monthBeforeLast3Months, monthBeforeLast4Months }) => {
|
||||
const queryParams = [];
|
||||
|
||||
if (today) {
|
||||
@@ -277,6 +277,26 @@ export default {
|
||||
queryParams.push(`thisYear_${thisYear.startTime}_${thisYear.endTime}`);
|
||||
}
|
||||
|
||||
if (lastMonth) {
|
||||
queryParams.push(`lastMonth_${lastMonth.startTime}_${lastMonth.endTime}`);
|
||||
}
|
||||
|
||||
if (monthBeforeLastMonth) {
|
||||
queryParams.push(`monthBeforeLastMonth_${monthBeforeLastMonth.startTime}_${monthBeforeLastMonth.endTime}`);
|
||||
}
|
||||
|
||||
if (monthBeforeLast2Months) {
|
||||
queryParams.push(`monthBeforeLast2Months_${monthBeforeLast2Months.startTime}_${monthBeforeLast2Months.endTime}`);
|
||||
}
|
||||
|
||||
if (monthBeforeLast3Months) {
|
||||
queryParams.push(`monthBeforeLast3Months_${monthBeforeLast3Months.startTime}_${monthBeforeLast3Months.endTime}`);
|
||||
}
|
||||
|
||||
if (monthBeforeLast4Months) {
|
||||
queryParams.push(`monthBeforeLast4Months_${monthBeforeLast4Months.startTime}_${monthBeforeLast4Months.endTime}`);
|
||||
}
|
||||
|
||||
return axios.get('v1/transactions/amounts.json' + (queryParams.length ? '?query=' + queryParams.join('|') : ''));
|
||||
},
|
||||
getTransaction: ({ id }) => {
|
||||
|
||||
Reference in New Issue
Block a user