www.webdeveloper.com
Results 1 to 15 of 221

Thread: Here are 2 prototype-functions I created.

Threaded View

  1. #11
    Join Date
    May 2003
    Location
    Between Baltimore and DC
    Posts
    3,579
    Here are a few more I use with Dates:

    Code:
     Date.prototype.MonthName =
      function(){
        var arrMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
        return arrMonths[this.getMonth()];
      }
    
     Date.prototype.DayName =
      function(){
        var arrDays = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
        return arrDays[this.getDay()];
      }
    
     Date.prototype.FirstDayInt =
      function(){
        this.setDate(1);
        return this.getDay();
      }
    
     Date.prototype.FirstDayStr =
      function(){
        var arrDays = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
        this.setDate(1);
        return arrDays[this.getDay()];
      }
    Eric
    Last edited by A1ien51; 05-12-2005 at 06:09 PM.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint] | twitter | linkedin | http://www.pascarello.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles