cl01/wp-content/plugins/category-posts/js/frontend/date.min.js
2025-02-24 12:39:24 +08:00

2 lines
720 B
JavaScript
Executable File

"undefined"!=typeof jQuery&&jQuery(document).ready((function(){var $elements=jQuery(".cat-post-item .cat-post-date[data-publishtime]");if(0!==$elements){var adjustlocalizeddate=function($elements){$elements.each((function(){var $this=jQuery(this),time=1e3*$this.data("publishtime"),format=$this.data("format"),orig_date=new Date(time);switch(format){case"date":$this.text(orig_date.toLocaleDateString());break;case"time":$this.text(orig_date.toLocaleDateString()+" "+orig_date.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}))}}))};adjustlocalizeddate($elements),jQuery("ul").on("catposts.load_more",".cat-post-item",(function(){adjustlocalizeddate(jQuery(this).find(".cat-post-date[data-publishtime]"))}))}}));