Here you can find the source of Format(fmt)
function datecompare(date1, date2){ if (!date1) { return 1; }/*from w w w . j av a 2s .com*/ if (!date2) { return -1; }; var strdt1=date1.replace("-","/"); var strdt2=date2.replace("-","/"); var d1 = new Date(Date.parse(strdt1)); var d2 = new Date(Date.parse(strdt2)); if(d1<d2){ return 1; } else if ( d1>d2 ){ return -1; } else{ return 0; } } Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //?? "d+": this.getDate(), //? "h+": this.getHours(), //?? "m+": this.getMinutes(), //? "s+": this.getSeconds(), //? "q+": Math.floor((this.getMonth() + 3) / 3), //?? "S": this.getMilliseconds() //?? }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }
Date.prototype.Format = function (fmt) { let values = { 'M+': this.getMonth() + 1, 'd+': this.getDate(), 'h+': this.getHours(), 'm+': this.getMinutes(), 's+': this.getSeconds(), 'q+': Math.floor((this.getMonth() + 3) / 3), 'S': this.getMilliseconds() ...
Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.Format = function(fmt) { var k, o, str; o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), ...
Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "H+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.Format = function (fmt) { str = fmt; str = str.replace(/yyyy|YYYY/, this.getFullYear()); str = str.replace(/mm/, this.getMonth() >= 9 ? this.getMonth() + 1 : '0' + (this.getMonth() + 1)); str = str.replace(/dd/, this.getDate() > 9 ? this.getDate() : '0' + this.getDate()); str = str.replace(/HH/, this.getHours() > 9 ? this.getHours() : '0' + this.getHours()); str = str.replace(/MM/, this.getMinutes() > 9 ? this.getMinutes() : '0' + this.getMinutes()); str = str.replace(/SS/, this.getSeconds() > 9 ? this.getSeconds() : '0' + this.getSeconds()); return str; ...
Date.prototype.Format = function(fmt) { var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), "s+": this.getSeconds(), "q+": Math.floor((this.getMonth() + 3) / 3), "S": this.getMilliseconds() ...
Date.prototype.Format = function (fmt) { if (fmt == undefined) { fmt = "yyyy/MM/dd-hh:mm:ss"; var o = { "M+": this.getMonth() + 1, "d+": this.getDate(), "h+": this.getHours(), "m+": this.getMinutes(), ...