Here you can find the source of toDateInputValue(()
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toJSON().slice(0,10); });//from ww w . j a va 2 s.co m
var prependZero = function(num) { return (num < 10)? ("0" + num) : num; Date.prototype.toCustomFormat = function() { var h = this.getHours(), h_12hr = (h % 12), hh = prependZero((h_12hr == 0)? 12 : h_12hr), mm = prependZero(this.getMinutes()), ss = prependZero(this.getSeconds()), ...
Date.prototype.toDate = function(){ return new Date(this.getFullYear(), this.getMonth(), this.getDate());
Date.prototype.toDateFormat = function (format) { format = format || "yyyy/mm/dd"; return format.toLowerCase() .replace(/yyyy/g, this.getFullYear()) .replace(/yy/g, this.getYear()) .replace(/mm/g, this.getMonth2()) .replace(/m/g, this.getMonth() + 1) .replace(/dd/g, this.getDate2()) .replace(/d/g, this.getDate()); ...
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()) return local.toJSON().slice(0,10);
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toISOString().substr(0,10); });
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toISOString().substr(0,10); });
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toJSON().slice(0,10); });
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toJSON().slice(0,10); });
Date.prototype.toDateInputValue = (function() { var local = new Date(this); local.setMinutes(this.getMinutes() - this.getTimezoneOffset()); return local.toJSON().slice(0, 10); });