Sha256: aba1216a8c8fedef456b6be984c0246dcdab924eb5602341d0277df68d6860dd

Contents?: true

Size: 617 Bytes

Versions: 3

Compression:

Stored size: 617 Bytes

Contents

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;
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jextend-0.1.4 vendor/assets/javascripts/jextend/date.js
jextend-0.1.3 vendor/assets/javascripts/jextend/date.js
jextend-0.1.2 vendor/assets/javascripts/jextend/date.js