generateValues = () => {
let days = [];
let nums = [];
Array(7).fill().forEach((i, index) => {
days.push(moment().subtract(index, 'days').format('ddd'));
nums.push(moment().subtract(index, 'days').format('D'));
});
return { days: days.reverse(), nums: nums.reverse() }
}
view raw generateValues.js hosted with ❤ by GitHub