[Javascript] Date.format 사용하기
Date.prototype.format = function(f) { if (!this.valueOf()) return " "; var weekName = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]; var d = this; return f.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi, function($1) { switch ($1) { case "yyyy": return d.getFullYear(); case "yy": return (d.getFullYear() % 1000).zf(2); case "MM": return (d.getMonth() + 1).zf(2); case "dd": return d.getDate().zf(2); cas..
Javascript
2023. 7. 19. 15:59