Bug mit der System.Web.Mvc DLL gefixt.
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
function parseTimeInputToIntegerArray(timeString) {
|
||||
var hoursToMinutes = timeString.split(":");
|
||||
var hours = parseInt(hoursToMinutes[0]);
|
||||
var minutes = parseInt(hoursToMinutes[1]);
|
||||
const hoursToMinutes = timeString.split(":");
|
||||
const hours = parseInt(hoursToMinutes[0]);
|
||||
const minutes = parseInt(hoursToMinutes[1]);
|
||||
|
||||
return [hours, minutes];
|
||||
}
|
||||
|
||||
function getDateFromPicker(pickerId) {
|
||||
try {
|
||||
var picker = $("#" + pickerId);
|
||||
const picker = $(`#${pickerId}`);
|
||||
|
||||
if(picker.length > 0) {
|
||||
picker.datetimepicker("show");
|
||||
picker.datetimepicker("hide");
|
||||
|
||||
var unixTime = picker.datetimepicker("date");
|
||||
var targetDate = new Date(unixTime);
|
||||
const unixTime = picker.datetimepicker("date");
|
||||
const targetDate = new Date(unixTime);
|
||||
|
||||
if(isValidDate(targetDate)) {
|
||||
return targetDate;
|
||||
@@ -24,36 +24,36 @@ function getDateFromPicker(pickerId) {
|
||||
|
||||
return new Date();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
} finally {
|
||||
return new Date();
|
||||
}
|
||||
}
|
||||
|
||||
function getTimeFromPicker(pickerId) {
|
||||
var result = new Date();
|
||||
const result = new Date();
|
||||
|
||||
try {
|
||||
var picker = $("#" + pickerId);
|
||||
const picker = $(`#${pickerId}`);
|
||||
|
||||
if (picker.length > 0) {
|
||||
var timeString = picker.val();
|
||||
const timeString = picker.val();
|
||||
if (timeString.length === 5) {
|
||||
var hours = timeString.substring(0, 2);
|
||||
var minutes = timeString.substring(3);
|
||||
const hours = timeString.substring(0, 2);
|
||||
const minutes = timeString.substring(3);
|
||||
|
||||
result.setHours(hours);
|
||||
result.setMinutes(minutes);
|
||||
|
||||
var date = result.getDate();
|
||||
var month = result.getMonth();
|
||||
var year = result.getYear();
|
||||
const date = result.getDate();
|
||||
const month = result.getMonth();
|
||||
const year = result.getYear();
|
||||
|
||||
return new Date(year, month, date, hours, minutes, 0, 0);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
} finally {
|
||||
return result;
|
||||
}
|
||||
@@ -61,37 +61,37 @@ function getTimeFromPicker(pickerId) {
|
||||
|
||||
function dateToShortDateString(date) {
|
||||
try {
|
||||
logInfo2("Konvertiere Datum zu kurzem Datum: " + date);
|
||||
logInfo2(`Konvertiere Datum zu kurzem Datum: ${date}`);
|
||||
|
||||
if (isValidDate(date)) {
|
||||
var ddNum = date.getDate();
|
||||
var mmNum = date.getMonth();
|
||||
var yyyyNum = date.getFullYear();
|
||||
const ddNum = date.getDate();
|
||||
const mmNum = date.getMonth();
|
||||
const yyyyNum = date.getFullYear();
|
||||
|
||||
var dd = ddNum.toString();
|
||||
var mm = mmNum.toString();
|
||||
var yyyy = yyyyNum.toString();
|
||||
let dd = ddNum.toString();
|
||||
let mm = mmNum.toString();
|
||||
let yyyy = yyyyNum.toString();
|
||||
|
||||
if (ddNum < 10) {
|
||||
dd = "0" + dd;
|
||||
dd = `0${dd}`;
|
||||
}
|
||||
|
||||
if (mmNum < 10) {
|
||||
mm = "0" + mm;
|
||||
mm = `0${mm}`;
|
||||
}
|
||||
|
||||
if (yyyyNum < 10) {
|
||||
yyyy = "000" + yyyyNum;
|
||||
yyyy = `000${yyyyNum}`;
|
||||
} else if (yyyyNum < 100) {
|
||||
yyyy = "00" + yyyyNum;
|
||||
yyyy = `00${yyyyNum}`;
|
||||
} else if (yyyyNum < 1000) {
|
||||
yyyy = "0" + yyyyNum;
|
||||
yyyy = `0${yyyyNum}`;
|
||||
}
|
||||
|
||||
return dd + "." + mm + "." + yyyy;
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,16 +100,16 @@ function mergeDateAndTime(date, time) {
|
||||
|
||||
try {
|
||||
if (isValidDate(date) && isValidDate(time)) {
|
||||
var day = date.getDate();
|
||||
var month = date.getMonth();
|
||||
var year = date.getFullYear();
|
||||
var hours = time.getHours();
|
||||
var minutes = time.getMinutes();
|
||||
const day = date.getDate();
|
||||
const month = date.getMonth();
|
||||
const year = date.getFullYear();
|
||||
const hours = time.getHours();
|
||||
const minutes = time.getMinutes();
|
||||
|
||||
result = new Date(year, month, day, hours, minutes, 0, 0);
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
} finally {
|
||||
return result;
|
||||
}
|
||||
@@ -120,21 +120,20 @@ function isValidDate(date) {
|
||||
return Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date);
|
||||
}
|
||||
|
||||
function ddMMyyyyToyyyyMMdd(dateString)
|
||||
{
|
||||
function ddMMyyyyToyyyyMMdd(dateString) {
|
||||
if (dateString === undefined || dateString === null || typeof dateString != "string" || dateString.length !== 10) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var dayMonthYear = dateString.split(".");
|
||||
const dayMonthYear = dateString.split(".");
|
||||
|
||||
if(dayMonthYear.length !== 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var dd = dayMonthYear[0];
|
||||
var mm = dayMonthYear[1];
|
||||
var yyyy = dayMonthYear[2];
|
||||
const dd = dayMonthYear[0];
|
||||
const mm = dayMonthYear[1];
|
||||
const yyyy = dayMonthYear[2];
|
||||
|
||||
return `${yyyy}-${mm}-${dd}`;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
var result = true;
|
||||
|
||||
if (a1 !== null && a2 !== null && Array.isArray(a1) && Array.isArray(a2)) {
|
||||
for (var i = 0; i < a2.length; i++) {
|
||||
for (let i = 0; i < a2.length; i++) {
|
||||
if (!a1.includes(a2[i])) {
|
||||
result = false;
|
||||
break;
|
||||
@@ -28,13 +28,13 @@ function isInArray(value, array) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var intValue = parseInt(value, 10);
|
||||
const intValue = parseInt(value, 10);
|
||||
|
||||
if (isNaN(intValue)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
if (array[i] === intValue) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function calculateTimeWithDuration(timeInputValue, timeElement, startDate, duration, hoursMinutesDropdownBtnId) {
|
||||
var isInMin = getIsZeiterfassungseinheitInMinutes();
|
||||
var isInMin = window.getIsZeiterfassungseinheitInMinutes();
|
||||
|
||||
const hoursToMinutes = parseTimeInputToIntegerArray(timeInputValue);
|
||||
const hours = parseInt(hoursToMinutes[0]);
|
||||
@@ -86,13 +86,13 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
|
||||
|
||||
// ToDo: Erst Dauer, dann Start- oder Endzeit führt dazu, dass die Dauer in Stunden benutzt wird!
|
||||
function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTimeId, durationId, hoursMinutesDropdownBtnId, startDatePickerId, endDatePickerId, isInvokedByStartElement, isInvokedByEndElement) {
|
||||
var startTime = $("#" + startTimeId).val();
|
||||
var endTime = $("#" + endTimeId).val();
|
||||
var duration = $("#" + durationId).val();
|
||||
var startTime = $(`#${startTimeId}`).val();
|
||||
var endTime = $(`#${endTimeId}`).val();
|
||||
var duration = $(`#${durationId}`).val();
|
||||
|
||||
var hoursMinutesDropdownButton = $("#" + hoursMinutesDropdownBtnId);
|
||||
|
||||
var isInMin = getIsZeiterfassungseinheitInMinutes();
|
||||
var isInMin = window.getIsZeiterfassungseinheitInMinutes();
|
||||
|
||||
if(hoursMinutesDropdownButton.length) {
|
||||
isInMin = hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") === "Minuten";
|
||||
@@ -188,4 +188,10 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
|
||||
$(`#${durationId}`).val(durationNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function calcTimeWithDuration() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user