Merge branch 'Development' into Main

This commit is contained in:
CasVT
2024-11-23 16:13:47 +01:00
2 changed files with 10 additions and 17 deletions

View File

@@ -35,17 +35,6 @@ function getSorting(type, key=false) {
return getLocalStorage(sorting_key)[sorting_key];
};
function getWeekDays(locale) {
const baseDate = new Date(Date.UTC(2017, 0, 2)); // just a Monday
const weekDays = [];
for (i = 0; i < 7; i++)
{
weekDays.push(baseDate.toLocaleDateString(locale, { weekday: 'short' }));
baseDate.setDate(baseDate.getDate() + 1);
}
return weekDays;
};
function getActiveTab() {
for (let t of Object.values(Types)) {
if (getComputedStyle(t).display === 'flex')
@@ -159,7 +148,7 @@ function evaluateSizing() {
Object.values(Types).forEach(t => fillLibrary(t));
setInterval(() => fillLibrary(Types.reminder), 60000);
const week_days = getWeekDays(getLocalStorage('locale')['locale']);
const week_days = ["Mo", "Tu", "We", "Thu", "Fr", "Sa", "Su"];
NavButtons.home.onclick = e => showWindow("home");
NavButtons.notification_services.onclick = e => showWindow("notification");

View File

@@ -545,11 +545,15 @@ function testService() {
const faulty_inputs =
[...NotiEls.add_service_window.querySelectorAll('input:not([data-regex=""])[data-regex]')]
.filter(el => !new RegExp
(
el.dataset.regex.split(',').slice(0, el.dataset.regex.split(',').length-1).join(','),
el.dataset.regex.split(',')[el.dataset.regex.split(',').length-1]
).test(el.value)
.filter(el =>
!(
(!el.required && el.value === '')
||
new RegExp(
el.dataset.regex.split(',').slice(0, el.dataset.regex.split(',').length-1).join(','),
el.dataset.regex.split(',')[el.dataset.regex.split(',').length-1]
).test(el.value)
)
);
if (faulty_inputs.length > 0) {
faulty_inputs.forEach(el => el.classList.add('error-input'));