баг-фикс 30/34
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { api } from '../api.js';
|
||||
import { escapeHtml, showAlert, hideAlert } from '../utils.js';
|
||||
import { api, getSession } from '../api.js';
|
||||
import { escapeHtml, formatLocalDate, showAlert, hideAlert } from '../utils.js';
|
||||
|
||||
const ROLE_DEPARTMENT = 'DEPARTMENT';
|
||||
|
||||
export async function initDepartmentWorkspace() {
|
||||
const role = localStorage.getItem('role');
|
||||
const userDepartmentId = localStorage.getItem('departmentId');
|
||||
const session = getSession();
|
||||
const role = session?.role;
|
||||
const userDepartmentId = session?.departmentId;
|
||||
const departmentField = document.getElementById('department-workspace-department-field');
|
||||
const departmentSelect = document.getElementById('department-workspace-department');
|
||||
const startInput = document.getElementById('department-workspace-start');
|
||||
@@ -493,14 +494,10 @@ function fillSelect(id, items, valueFn, labelFn, emptyLabel) {
|
||||
|
||||
function setDefaultDates(startInput, endInput) {
|
||||
const today = new Date();
|
||||
const nextWeek = new Date();
|
||||
const nextWeek = new Date(today);
|
||||
nextWeek.setDate(today.getDate() + 7);
|
||||
startInput.value = toIsoDate(today);
|
||||
endInput.value = toIsoDate(nextWeek);
|
||||
}
|
||||
|
||||
function toIsoDate(date) {
|
||||
return date.toISOString().slice(0, 10);
|
||||
startInput.value = formatLocalDate(today);
|
||||
endInput.value = formatLocalDate(nextWeek);
|
||||
}
|
||||
|
||||
function formatDateTime(value) {
|
||||
|
||||
Reference in New Issue
Block a user