Skip to content

Commit

Permalink
fix timezone form bug; fix stipend calculation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreywescott committed Jul 20, 2017
1 parent b32dd84 commit 5ddfc60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/store/calculations.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {

const totalStipendReceived = (stipendAmount, isTakingLaptopStipend) => {
const laptopStipendReceived = isTakingLaptopStipend ? LAPTOP_STIPEND_AMOUNT : 0
return stipendAmount + laptopStipendReceived
const received = stipendAmount + laptopStipendReceived
return received
}

const programISAMonthlyPayment = (expectedAnnualSalary, programISAPercentage) => {
Expand Down
6 changes: 3 additions & 3 deletions src/store/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
const defaultStartDate = nextStartDate()

export const defaultFormInputs = {
startDate: defaultStartDate.toISOString(),
exitDate: expectedExitDate(defaultStartDate).toISOString(),
startDate: momentDayOnly(defaultStartDate).format('YYYY-MM-DD'),
exitDate: momentDayOnly(expectedExitDate(defaultStartDate)).format('YYYY-MM-DD'),
stipendAmount: LIVING_FUND_STIPEND_AMOUNT,
isTakingLaptopStipend: true,
expectedAnnualSalary: 90000,
Expand Down Expand Up @@ -65,7 +65,7 @@ export const updateForm = formData => (dispatch, getState) => {
// half a second before dispatching the RECALCULATE action
clearTimeout(form.recalculateTimer)
const recalculateTimer = setTimeout(() => {
dispatch({...formData, recalculateTimer: null, type: actionTypes.RECALCULATE})
dispatch({...getState().form, recalculateTimer: null, type: actionTypes.RECALCULATE})
}, 500)

// update the form values immediately
Expand Down

0 comments on commit 5ddfc60

Please sign in to comment.