Skip to content

Commit

Permalink
NOBUG: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ayastreb committed Nov 11, 2018
1 parent f53fba3 commit d7141de
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true
}
24 changes: 12 additions & 12 deletions src/entities/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ const Report = {
{
key: REPORT_EXPENSE_INCOME,
value: REPORT_EXPENSE_INCOME,
text: 'Expense & Income'
text: 'Expense & Income',
},
{
key: REPORT_EXPENSE_TAGS,
value: REPORT_EXPENSE_TAGS,
text: 'Expense by Tags'
text: 'Expense by Tags',
},
{
key: REPORT_NET_WORTH,
value: REPORT_NET_WORTH,
text: 'Net Worth'
}
text: 'Net Worth',
},
]
},
timespanOptions() {
return [
{
key: TIMESPAN_YEARLY,
value: TIMESPAN_YEARLY,
text: 'Yearly'
text: 'Yearly',
},
{
key: TIMESPAN_MONTHLY,
value: TIMESPAN_MONTHLY,
text: 'Monthly'
}
text: 'Monthly',
},
]
},
timespanLabel(date, timespan) {
Expand All @@ -79,7 +79,7 @@ const Report = {
transactionFilters(report) {
return {
date: report.date,
accounts: report.accounts
accounts: report.accounts,
}
},
prepareData(report, transactions, base, exchangeRate, netWorthEnd) {
Expand All @@ -99,18 +99,18 @@ const Report = {
default:
return undefined
}
}
},
}

export default Report

function dateRange(date, timespan) {
const start = timespan === TIMESPAN_YEARLY ? startOfYear : startOfMonth
const end = timespan === TIMESPAN_YEARLY ? endOfYear : endOfMonth
let tempDate = new Date(date);
tempDate.setDate(tempDate.getDate()+1);
const tempDate = new Date(date)
tempDate.setDate(tempDate.getDate() + 1)
return {
start: toUtcTimestamp(start(tempDate)),
end: toUtcTimestamp(end(tempDate))
end: toUtcTimestamp(end(tempDate)),
}
}
9 changes: 3 additions & 6 deletions src/selectors/ui/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import Report from '../../entities/Report'

export const getReport = state => state.ui.report
export const getTimespanLabel = state => {
let startdate = new Date(state.ui.report.date.start);
startdate.setDate(startdate.getDate()+1);
return Report.timespanLabel(
startdate,
state.ui.report.timespan
)
const startDate = new Date(state.ui.report.date.start)
startDate.setDate(startDate.getDate() + 1)
return Report.timespanLabel(startDate, state.ui.report.timespan)
}

0 comments on commit d7141de

Please sign in to comment.