April 2017
Intermediate to advanced
414 pages
8h 14m
English
To begin, we will need to make an addition to our storageMethods file to grab the current month's spent amount so that we can calculate the progress prop for ProgressViewIOS. This can be done by modifying checkCurrentMonthBudget:
// Expenses/app/utils/storageMethods.js export const checkCurrentMonthBudget = async () => { let year = dateMethods.getYear(); let month = dateMethods.getMonth(); let response = await getAsyncStorage(); if (response === null || !response.hasOwnProperty(year) || !response[year].hasOwnProperty(month)) { return false; } let details = response[year][month]; return { budget: details.budget, spent: details.spent } }
Here, we are returning an object containing both the budget and spent ...
Read now
Unlock full access