I'm implementing a custom algorithm to disable dates depending on a set of rules that also depend on what the current day is. To test that I would need to set the current date to a specific date.
I found this thread that just overwrites javascripts Date function. My problem is that if I do that the calendar doesn't work as expected anymore. Most of the time all days are just missing, sometimes all are disabled.
var oldDate = Date;
Date = function (fake)
{
if( ! fake ) return new oldDate('02/26/2017');
return new oldDate(fake);
}
Date.prototype = oldDate.prototype;
How can I test the datepicker with a custom current date? It should be as easy as setting up a jsfiddle (if possible): My current Fiddle