Here you can find the source of format(fmt)
Date.prototype.format = function (fmt) { var o = {/* w w w.j a v a 2 s. com*/ "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; }
var DayNames = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); var MonthNames = new Array('January','February','March','April','May','June', 'July', 'August', 'September', 'October', 'November', 'December'); if(!encodeURIComponent) { encodeURIComponent = function(str){ return escape(str); }; decodeURIComponent = function(str){ return unescape(str); }; }; Date.prototype.format = function(f) { ...
Date.prototype.format = function (fmt) { var date = this; return fmt.replace( /\{([^}:]+)(?::(\d+))?\}/g, function (s, comp, pad) { var fn = date["get" + comp]; if (fn) { var v = (fn.call(date) + (/Month$/.test(comp) ? 1 : 0)).toString(); ...
Date.DATETIME_FORMAT = "yyyy-MM-dd hh:mm:ss"; Date.DATE_FORMAT = "yyyy-MM-dd"; Date.prototype.format = function(fmt) { var o = { y: this.getFullYear(), M: this.getMonth() + 1, d: this.getDate(), h: this.getHours(), m: this.getMinutes(), ...
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) { 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() ...
'use strict'; 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), ...
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() ...