,
I want to convert to
in yyyy-MM-dd HH:mm:ss format.
,
I want to convert to
in yyyy-MM-dd HH:mm:ss format.use the library, date-fns or moment
or there is an old piece of code that extends the Date
object
Date.prototype.format = function(format = "yyyy-MM-dd") {
var o = {
//month
"M+": this.getMonth() + 1,
// day + 1
"d+": this.getDate(),
// hour 24
"H+": this.getHours(),
// 12
"h+": this.getHours() % 12,
// minute
"m+": this.getMinutes(),
// second
"s+": this.getSeconds(),
// quarter
"q+": Math.floor((this.getMonth() + 3) / 3),
// millisecond
"S": this.getMilliseconds()
};
if (/(y+)/i.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};
in learning sharp jquery, I encountered a problem when I introduced the old version of jquery (version 1.71 in the book) and the latest version of jquery when the structure and content of html were the same. has a total of four check boxes, which work...
<div id= div1 > <div id= div2 > < div> < div> $( -sharpdiv1 ).on( click ,function(){ div2 })...
I write button in the a tag, so clicking button will automatically trigger the event bound by the outer a tag. Is there any way not to trigger it? <a href="-sharp" show-id="15"> <div class="online-top"> ...
js first gets the height of a picture, and then assigns a value to the height of a div. Why is it displayed after refreshing? how to solve it? ask for the elder s advice. Thank you! ...
before I destroy the instance in demo, the instance is reinitialized, which is ok: var handler = function () { alert(12111); } var handler1 = function () { alert(22222); } var player; play(handler); function play(handler) { videojs("ex...
,0,0 ...
desired effect: for example: click on the man, pop up to expand the men s navigation bar on the right, and how to modify jquery to achieve this function this is the html section <header class="headroom"> <a id="cd-logo...
$( "body "). On ( "click ", "selector ", function () {}) this is the method that is called after the dynamically generated element is clicked. I now dynamically generate input and then immediately get this dynamically generated element without trigger...
I used jQuery-Seat-Charts v1.1.1 to make a reservation web page. I have made it possible that when a person clicks a branch map, the div will change and become the seat reservation map of the branch ordered by the user. The point now is that although my...
if($(".ing>img").hasClass("show")){ }else{ $(".ing>img").addClass("show"); } ...
now a page has two parts with invalid icons up and down, which means to encapsulate it. all define class as item-up,item-down. however, it is found that only the first top icon is invalid, and the second bottom icon is invalid. cannot invalidate each...
the number on this phone scrolls too fast, how can you slow down and slide a number? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="wi...