AlexTCGPro
Member
Hey guys, I'm trying to set a jdate range filter via javascript, I'm using this code:
However, the date always defaults to the current date in both inputs, actually no matter what value I put via javascript it will always return the current date. I'm guessing I'm not setting the right input box, however that was the only ones I could find inspecting the code, could you give me a hand?
Code:
function filterDate() {
var fd = Date.today().clearTime().moveToFirstDayOfMonth();
var firstday = fd.toString("dd/MM/yyyy") + " 00:00:00";
var ld = Date.today().clearTime().moveToLastDayOfMonth();
var lastday = ld.toString("dd/MM/yyyy") + " 23:59:59";
document.querySelector("#test_table___date_19_mod_fabrik_list_124_filter_range_0_\\.0").value = firstday;
document.querySelector("#test_table___date_19_mod_fabrik_list_124_filter_range_1_\\.0").value = lastday;
Fabrik.getBlock('list_19').doFilter();
}