File: D:/HostingSpaces/SBogers10/hours.komma.pro/resources/assets/js/createFilterParams.js
//get url params by name
$.urlParam = function (name) {
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
};
//make new url by chosen begin date
// function updateQueryString(key, value) {
// if (window.location.search.indexOf(key + '=') > -1) {
// $current = $.urlParam(key);
// if ($current == 0) {
// $url = window.location.href;
// $split = $url.split(key + '=');
// $url = $split[0] + key + "=" + value + $split[1];
// }
// else {
// $url = window.location.href.replace($current, value);
// }
// } else {
// if (!window.location.search) {
// $url = window.location.href + '?' + key + '=' + value;
// }
// else {
// $url = window.location.href + '&' + key + '=' + value;
// }
// }
// window.location.assign($url);
// }
$(document).on( "change", "#begin", function () {
updateQueryString('begin', $(this).val())
});
$(document).on( "change", "#end", function () {
updateQueryString('end', $(this).val())
});
$(document).on( "change", "select#projectWorker", function () {
console.log("#projectWorker changed");
updateQueryString('user', $(this).val())
});
console.log("init FilterParams.js");