Edit This Code:
See Result »
Click the button to display the date after changing it to be the last day of the previous month.
Try it
Result: