#100 ✓not_for_core
Laurent Fortin

getLastDayOfMonth() for Date

Reported by Laurent Fortin | May 14th, 2008 @ 10:11 PM

This is an enhancement request/suggestion:

A method that would return the last day of the month for any given date.

example: new Date(2008, 1, 15).getLastDayOfMonth() would return 29.

Here would be the code to include in prototype.js right after toJSON() :

Date.prototype.getLastDayOfMonth = function() {
  return new Date(new Date(this.getFullYear(),this.getMonth()+1,0)).getDate();

Thanks for giving me the chance to contribute! :-)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket