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