Nodejs Date Format ToShortFormat()

Here you can find the source of ToShortFormat()

Method Source Code

Date.prototype.ToShortFormat = function()
{
   return formatTime(this.getHours(), this.getMinutes()) + ", " + this.toDateString();
}

Related

  1. shortFormat()
    Date.prototype.shortFormat = function() {
      return (this.getMonth() + 1) + "/" + this.getDate() + "/" + this.getFullYear();
    
  2. simpleFormat()
    Date.prototype.simpleFormat = function()
        var d=this;
        return (""+d.getFullYear()+"-"+("00" + (d.getMonth() + 1)).slice(-2)) + "-" +
            ("00" + d.getDate()).slice(-2);
    };
    
  3. simpleFormatWithMinutes()
    Date.prototype.simpleFormatWithMinutes = function()
        var d=this;
        return (""+d.getFullYear()+"-"+("00" + (d.getMonth() + 1)).slice(-2)) + "-" +
            ("00" + d.getDate()).slice(-2)  +" "+
            ("00" + d.getHours()).slice(-2) + ":" +
            ("00" + d.getMinutes()).slice(-2)
    };
    Array.prototype.contains = function(obj) {
    ...
    
  4. simpleDateString()
    Date.prototype.simpleDateString = function() {
        function pad(value)
            return ("0" + value).slice(-2);
        var dateString = this.getFullYear() + "-" +
                pad(this.getMonth() + 1, 2) + '-' +
                pad(this.getDate(), 2);
        return dateString;
    ...
    
  5. simpleDateString()
    Date.prototype.simpleDateString = function () {
      var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
      var month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
      return days[this.getDay()] + ', ' + month[this.getMonth()] + ' ' + this.getDate();
    };