When managing dates, it is good practice to choose only one robust library and stick to it. To look up later, I wanted to keep one specific moment.js usage here.
Solution
Start date of the previous month
const startDate = moment().add(-1, 'months').startOf('month');
End date of the previous month
const endDate = moment().add(-1, 'months').endOf('month');
Conclusion
Thank you for reading! I hope you have found this post helpful.
Reference
Cover Photo by Andreas Gücklhorn on Unsplash
Moment Doc: Start of Time
Moment Doc: End of Time