2018-05-26 16:32:20 +02:00
|
|
|
|
$(function () {
|
|
|
|
|
$(".localizeDate").each(function (index) {
|
|
|
|
|
var serverDate = $(this).text();
|
|
|
|
|
var localDate = new Date(serverDate);
|
|
|
|
|
|
|
|
|
|
var dateString = localDate.toLocaleDateString() + " " + localDate.toLocaleTimeString();
|
|
|
|
|
$(this).text(dateString);
|
|
|
|
|
});
|
2019-01-14 22:43:29 +01:00
|
|
|
|
|
|
|
|
|
|
2019-03-07 06:29:29 +01:00
|
|
|
|
$(".input-group-clear").on("click", function () {
|
2019-01-14 22:43:29 +01:00
|
|
|
|
$(this).parents(".input-group").find("input").val(null);
|
2019-03-07 06:29:29 +01:00
|
|
|
|
handleInputGroupClearButtonDisplay(this);
|
2019-01-14 22:43:29 +01:00
|
|
|
|
});
|
|
|
|
|
|
2019-03-07 06:29:29 +01:00
|
|
|
|
$(".input-group-clear").each(function () {
|
|
|
|
|
var inputGroupClearBtn = this;
|
|
|
|
|
handleInputGroupClearButtonDisplay(inputGroupClearBtn);
|
|
|
|
|
$(this).parents(".input-group").find("input").on("change input", function () {
|
|
|
|
|
handleInputGroupClearButtonDisplay(inputGroupClearBtn);
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2019-01-14 22:43:29 +01:00
|
|
|
|
$(".only-for-js").show();
|
2019-03-07 06:29:29 +01:00
|
|
|
|
|
|
|
|
|
function handleInputGroupClearButtonDisplay(element) {
|
2019-05-07 10:01:37 +02:00
|
|
|
|
var inputs =$(element).parents(".input-group").find("input");
|
|
|
|
|
|
|
|
|
|
$(element).hide();
|
|
|
|
|
for (var i = 0; i < inputs.length; i++) {
|
|
|
|
|
var el = inputs.get(i);
|
|
|
|
|
if($(el).val() || el.attributes.value){
|
|
|
|
|
$(element).show();
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-03-07 06:29:29 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-26 16:32:20 +02:00
|
|
|
|
});
|
2019-04-26 01:22:04 +02:00
|
|
|
|
|
|
|
|
|
function switchTimeFormat() {
|
|
|
|
|
$(".switchTimeFormat").each(function (index) {
|
|
|
|
|
var htmlVal = $(this).html();
|
|
|
|
|
var switchVal = $(this).attr("data-switch");
|
|
|
|
|
|
|
|
|
|
$(this).html(switchVal);
|
|
|
|
|
$(this).attr("data-switch", htmlVal);
|
|
|
|
|
});
|
|
|
|
|
}
|