mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-13 21:17:33 +00:00
[UI] Adjust week start date (#11934)
* Adjust week start date Co-authored-by: Copilot <copilot@github.com> * Change to global setting --------- Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -32,11 +32,22 @@ Configuration of basic server settings:
|
||||
{{ globalsetting("INVENTREE_RESTRICT_ABOUT") }}
|
||||
{{ globalsetting("DISPLAY_FULL_NAMES") }}
|
||||
{{ globalsetting("DISPLAY_PROFILE_INFO") }}
|
||||
{{ globalsetting("INVENTREE_UPDATE_CHECK_INTERVAL") }}
|
||||
{{ globalsetting("WEEK_STARTS_ON") }}
|
||||
|
||||
Configuration of image download settings:
|
||||
|
||||
| Name | Description | Default | Units |
|
||||
| ---- | ----------- | ------- | ----- |
|
||||
{{ globalsetting("INVENTREE_DOWNLOAD_FROM_URL") }}
|
||||
{{ globalsetting("INVENTREE_DOWNLOAD_IMAGE_MAX_SIZE") }}
|
||||
{{ globalsetting("INVENTREE_DOWNLOAD_FROM_URL_USER_AGENT") }}
|
||||
{{ globalsetting("INVENTREE_STRICT_URLS") }}
|
||||
|
||||
Configuration of various scheduled tasks:
|
||||
|
||||
| Name | Description | Default | Units |
|
||||
| ---- | ----------- | ------- | ----- |
|
||||
{{ globalsetting("INVENTREE_UPDATE_CHECK_INTERVAL") }}
|
||||
{{ globalsetting("INVENTREE_BACKUP_ENABLE") }}
|
||||
{{ globalsetting("INVENTREE_BACKUP_DAYS") }}
|
||||
{{ globalsetting("INVENTREE_DELETE_TASKS_DAYS") }}
|
||||
|
||||
@@ -1210,6 +1210,20 @@ SYSTEM_SETTINGS: dict[str, InvenTreeSettingsKeyType] = {
|
||||
'default': True,
|
||||
'validator': bool,
|
||||
},
|
||||
'WEEK_STARTS_ON': {
|
||||
'name': _('Week Starts On'),
|
||||
'description': _('Starting day of the week, for display in calendar views'),
|
||||
'default': '1',
|
||||
'choices': [
|
||||
('0', _('Sunday')),
|
||||
('1', _('Monday')),
|
||||
('2', _('Tuesday')),
|
||||
('3', _('Wednesday')),
|
||||
('4', _('Thursday')),
|
||||
('5', _('Friday')),
|
||||
('6', _('Saturday')),
|
||||
],
|
||||
},
|
||||
'TEST_STATION_DATA': {
|
||||
'name': _('Enable Test Station Data'),
|
||||
'description': _('Enable test station data collection for test results'),
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
} from '../../contexts/LanguageContext';
|
||||
import type { CalendarState } from '../../hooks/UseCalendar';
|
||||
import { useLocalState } from '../../states/LocalState';
|
||||
import { useGlobalSettingsState } from '../../states/SettingsStates';
|
||||
import { FilterSelectDrawer } from '../../tables/FilterSelectDrawer';
|
||||
|
||||
export interface InvenTreeCalendarProps extends CalendarOptions {
|
||||
@@ -57,6 +58,8 @@ export default function Calendar({
|
||||
state,
|
||||
...calendarProps
|
||||
}: Readonly<InvenTreeCalendarProps>) {
|
||||
const globalSettings = useGlobalSettingsState();
|
||||
|
||||
const [monthSelectOpened, setMonthSelectOpened] = useState<boolean>(false);
|
||||
|
||||
const [filtersVisible, setFiltersVisible] = useState<boolean>(false);
|
||||
@@ -206,6 +209,10 @@ export default function Calendar({
|
||||
initialView='dayGridMonth'
|
||||
locales={allLocales}
|
||||
locale={calendarLocale}
|
||||
firstDay={Number.parseInt(
|
||||
globalSettings.getSetting('WEEK_STARTS_ON') ?? '1',
|
||||
10
|
||||
)}
|
||||
headerToolbar={false}
|
||||
footerToolbar={false}
|
||||
{...calendarProps}
|
||||
|
||||
@@ -44,7 +44,9 @@ export default function SystemSettings() {
|
||||
label: t`Server`,
|
||||
icon: <IconServerCog />,
|
||||
content: (
|
||||
<>
|
||||
<GlobalSettingList
|
||||
heading={t`Server Settings`}
|
||||
keys={[
|
||||
'INVENTREE_BASE_URL',
|
||||
'INVENTREE_COMPANY_NAME',
|
||||
@@ -57,11 +59,22 @@ export default function SystemSettings() {
|
||||
'INVENTREE_RESTRICT_ABOUT',
|
||||
'DISPLAY_FULL_NAMES',
|
||||
'DISPLAY_PROFILE_INFO',
|
||||
'INVENTREE_UPDATE_CHECK_INTERVAL',
|
||||
'WEEK_STARTS_ON'
|
||||
]}
|
||||
/>
|
||||
<GlobalSettingList
|
||||
heading={t`Image Download Settings`}
|
||||
keys={[
|
||||
'INVENTREE_DOWNLOAD_FROM_URL',
|
||||
'INVENTREE_DOWNLOAD_IMAGE_MAX_SIZE',
|
||||
'INVENTREE_DOWNLOAD_FROM_URL_USER_AGENT',
|
||||
'INVENTREE_STRICT_URLS',
|
||||
'INVENTREE_STRICT_URLS'
|
||||
]}
|
||||
/>
|
||||
<GlobalSettingList
|
||||
heading={t`Scheduled Tasks`}
|
||||
keys={[
|
||||
'INVENTREE_UPDATE_CHECK_INTERVAL',
|
||||
'INVENTREE_BACKUP_ENABLE',
|
||||
'INVENTREE_BACKUP_DAYS',
|
||||
'INVENTREE_DELETE_TASKS_DAYS',
|
||||
@@ -71,6 +84,7 @@ export default function SystemSettings() {
|
||||
'INVENTREE_PROTECT_EMAIL_LOG'
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user