Here you can find the source of toDateFromAspNet()
/// <reference path="VsixMvcAppResult.A.Intellisense.js" /> if (!window.console) { console = {/*from w w w . ja va2 s .c o m*/ log: function (msg) { } }; }; String.prototype.toDateFromAspNet = function () { var dte = eval("new " + this.replace(/\//g, '') + ";"); dte.setMinutes(dte.getMinutes() - dte.getTimezoneOffset()); return dte; }; String.prototype.toBoolean = function () { return (/^true$/i).test(this); }; function parseBoolean(value) { return value.toBoolean(); } var VsixMvcAppResult = {};
String.prototype.toDate = () =>{ var from = $(this).val().split("/"); var f = new Date(from[2], from[1] - 1, from[0]); return f;
String.THROW_WHEN_INVALID_DATE = true String.prototype.toDate = function(dateIsOmittable, monthIsOmittable) { var date = null; var str = "0000-00-00"; if (/^\d{4}-\d{2}-\d{2}$/.test(this)) str = new String(this); else if (dateIsOmittable && /^\d{4}-\d{2}$/.test(this)) str = this + "-01"; else if (dateIsOmittable && monthIsOmittable && /^\d{4}$/.test(this)) ...
String.prototype.toDate = function (pattern = 'YYYY-MM-DD') { let date = new Date() if (pattern.indexOf("YYYY") > -1) { const yearIndex = pattern.indexOf("YYYY") date.setFullYear(this.substring(yearIndex,yearIndex+4)) if(pattern.indexOf("MM")>-1){ const monthIndex = pattern.indexOf("MM") date.setMonth(this.substring(monthIndex,monthIndex+2)-1) ...
String.prototype.toDate = function(str) { var m = this.match(/(\d+)-(\d+)-(\d+)\s+(\d+):(\d+):(\d+)/); return new Date(+m[1], +m[2] - 1, +m[3], +m[4], +m[5], +m[6]);
String.prototype.toDateFormat = function (format) { return this.parseToDate().toDateFormat(format); };
String.prototype.toDateFromAspNet = function () { var dte = eval("new " + this.replace(/\ dte.setMinutes(dte.getMinutes() - dte.getTimezoneOffset()); return dte; };
String.prototype.getDate = function() { return this.toDate().getDate();
Date.prototype.getDateString = function(){ var S = this.getSeconds(), M = this.getMinutes(), H = this.getHours(), dd = this.getDate(), mm = this.getMonth()+1, yyyy = this.getFullYear(); if(dd<10){ dd ='0'+dd if(mm<10) { ...
Date.prototype.getDateString = function () { return this.getFullYear() + '/' + this.getMonth2() + '/' + this.getDate2(); }; Date.prototype.addDays = function (days) { this.setDate(this.getDate() + days); return this; }; Date.prototype.getDate2 = function () { var date = this.getDate(); ...