@LanceLiang2011
Posted
Hi Adriam,
Firstly, I want to commend you on the remarkable job you've done on this project. Your hard work and attention to detail are evident.
However, there are a few minor issues regarding the logic of date calculation that need addressing. For instance, when inputting the date from yesterday into your calculator, it returns '-1 month and 1 day'. This can be attributed to JavaScript's usage of zero-based indexing for month. It would be beneficial to take this peculiarity into account to refine your calculations and provide more precise results.
Additionally, the current front-end data checking allows input of dates from the next month. This might unintentionally disrupt your user interface.
Accurate date calculation in JavaScript, especially accounting for leap years, can be quite challenging. If you find this to be the case, consider integrating a third-party library, such as Moment.js or date-fns, which can greatly simplify the process and ensure precision.
Keep up the good work!
Marked as helpful
@cosmologysk8
Posted
@LanceLiang2011
Thank you for your feedback Lance, I appreciate it.
I will try use Moment.js to simplify the process with Dates