From 6046bb283c5d439bf7131714a8ee0aa46d816130 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 19:26:45 +0000 Subject: [PATCH 1/4] Show unreported lessons in teacher-reported-today report Add a lessonTimes setting (lesson start/end times per group of weekdays) next to lateValue. The teacher-reported-today report maps each report to the lesson it was made in, and shows an empty slot for every lesson with no report between the first and last reported lessons of a class's day. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0174KSELfDgGPRrqq6ffo7Gw --- client/src/domainTranslations.js | 5 ++ .../src/entities/teacher-reported-today.jsx | 22 ++++- client/src/roadmapFeatures.js | 1 + client/src/settings/GeneralSettingsInput.jsx | 27 +++++- client/src/settings/Settings.jsx | 3 +- client/src/settings/settingsUtil.js | 9 ++ client/src/utils/lessonGaps.js | 70 ++++++++++++++++ client/src/utils/lessonGaps.test.js | 83 +++++++++++++++++++ 8 files changed, 215 insertions(+), 5 deletions(-) create mode 100644 client/src/utils/lessonGaps.js create mode 100644 client/src/utils/lessonGaps.test.js diff --git a/client/src/domainTranslations.js b/client/src/domainTranslations.js index f6aa44a0..1834bd00 100644 --- a/client/src/domainTranslations.js +++ b/client/src/domainTranslations.js @@ -15,6 +15,11 @@ export default { fields: { defaultPageSize: 'מספר שורות בטבלה', lateValue: 'שווי איחור', + lessonTimes: 'זמני שיעורים', + 'lessonTimes.days': 'ימים', + 'lessonTimes.periods': 'שיעורים', + 'lessonTimes.periods.start': 'שעת התחלה', + 'lessonTimes.periods.end': 'שעת סיום', phoneNumber: 'מספר טלפון', mailAddressTitle: 'שם השולח', mailAddressAlias: 'כתובת השולח', diff --git a/client/src/entities/teacher-reported-today.jsx b/client/src/entities/teacher-reported-today.jsx index 1d050d47..94abf8b4 100644 --- a/client/src/entities/teacher-reported-today.jsx +++ b/client/src/entities/teacher-reported-today.jsx @@ -8,6 +8,8 @@ import { adminUserFilter } from '@shared/components/fields/PermissionFilter'; import { filterArrayByParams } from '@shared/utils/filtersUtil'; import { useIsAdmin } from '@shared/utils/permissionsUtil'; import { MAX_PAGE_SIZE } from '@shared/config/settings'; +import { useLessonTimes } from 'src/settings/settingsUtil'; +import { withLessonGaps } from 'src/utils/lessonGaps'; // This is a card view, not a table, so cap high rather than paginate at 10 rows. const LIST_PAGE_SIZE = 1000; @@ -179,8 +181,23 @@ const LessonRow = ({ row, showDate, until }) => { ); }; +// A lesson from the lessonTimes setting that had no report while later lessons that day did. +const GapRow = ({ gap, showDate }) => ( + + + + {showDate && `${formatDate(gap.reportDate)} `}{gap.period.start} + + + שיעור {gap.period.number} ({gap.period.start}–{gap.period.end}) לא דווח + + + +); + const TeacherReportCards = ({ isAdmin }) => { const { data, total, filterValues } = useListContext(); + const lessonTimes = useLessonTimes(); const rows = data || []; const klasses = groupByKlass(rows); // Show the date on each row unless the filter is a single day. @@ -220,8 +237,9 @@ const TeacherReportCards = ({ isAdmin }) => { )} - {klass.lessons.map((row) => ( - + {withLessonGaps(klass.lessons, lessonTimes).map((row) => (row.isGap + ? + : ))} ); diff --git a/client/src/roadmapFeatures.js b/client/src/roadmapFeatures.js index b3f79345..dcab90ee 100644 --- a/client/src/roadmapFeatures.js +++ b/client/src/roadmapFeatures.js @@ -35,6 +35,7 @@ export default [ { html: 'דוח חדש "מעקב חיסורים": כרטיס לכל כיתה, סף חיסורים לבחירה, כמה חיסורים נשארו לכל תלמידה עד הסף ופירוט בלחיצה', status: 'בוצע', statusColor: 'success' }, { html: 'מסך ההגדרות: הגדרת שם וכתובת השולח במיילים שנשלחים מהמערכת', status: 'בוצע', statusColor: 'success' }, { html: 'רשימת דיווחי נוכחות: פעולה "עריכה מרוכזת" לשינוי תאריך, כיתה, מורה, שיעור ועוד במספר רשומות יחד (שדה ריק לא משתנה)', status: 'בוצע', statusColor: 'success' }, + { html: 'הגדרת זמני שיעורים לכל יום במסך ההגדרות, ובדוח המורות שדיווחו: ריבוע ריק לשיעור שלא דווח באמצע היום', status: 'בוצע', statusColor: 'success' }, // { html: 'הגדרת תקופת זמן לפי תאריכים', status: 'בקרוב', statusColor: 'warning' }, // { html: 'הגדרת תקופת זמן לפי יום בשבוע', status: 'בוצע', statusColor: 'success' }, diff --git a/client/src/settings/GeneralSettingsInput.jsx b/client/src/settings/GeneralSettingsInput.jsx index 837f2f10..4f5a6661 100644 --- a/client/src/settings/GeneralSettingsInput.jsx +++ b/client/src/settings/GeneralSettingsInput.jsx @@ -1,16 +1,25 @@ -import { NumberInput, required } from 'react-admin'; +import { ArrayInput, CheckboxGroupInput, NumberInput, SimpleFormIterator, TextInput, required } from 'react-admin'; import { CommonSettingsAccordion } from '@shared/components/settings/CommonSettingsAccordion'; import CommonAutocompleteInput from '@shared/components/fields/CommonAutocompleteInput'; import { PAGE_SIZE_OPTIONS } from '@shared/config/settings'; const pageSizeOptions = PAGE_SIZE_OPTIONS.map((option) => ({ id: option, name: option })); +const weekdayChoices = [ + { id: 0, name: 'ראשון' }, + { id: 1, name: 'שני' }, + { id: 2, name: 'שלישי' }, + { id: 3, name: 'רביעי' }, + { id: 4, name: 'חמישי' }, + { id: 5, name: 'שישי' }, +]; + export function GeneralSettingsInput() { return ( + + + + + + + + + + + ); } diff --git a/client/src/settings/Settings.jsx b/client/src/settings/Settings.jsx index 5e7e06e0..4326a951 100644 --- a/client/src/settings/Settings.jsx +++ b/client/src/settings/Settings.jsx @@ -14,7 +14,7 @@ import { useNavigate } from 'react-router-dom'; import { getDefaultPageSize } from '@shared/utils/settingsUtil'; import { CommonSettingsAccordion } from '@shared/components/settings/CommonSettingsAccordion'; import { DashboardItemsInput } from '@shared/components/settings/DashboardItemsInput'; -import { getLateValue, getDashboardItems, getReportStyles, getReportCardSettings, normalizeReportStyles } from './settingsUtil'; +import { getLateValue, getLessonTimes, getDashboardItems, getReportStyles, getReportCardSettings, normalizeReportStyles } from './settingsUtil'; import { ReportStylesInput } from './ReportStylesInput'; import { GeneralSettingsInput } from './GeneralSettingsInput'; import { MailSettingsInput } from './MailSettingsInput'; @@ -39,6 +39,7 @@ export default function Settings() { const defaultValues = { defaultPageSize: getDefaultPageSize(identity), lateValue: getLateValue(identity), + lessonTimes: getLessonTimes(identity), dashboardItems: getDashboardItems(identity), reportStyles: normalizeReportStyles(getReportStyles(identity)), reportCardSettings: getReportCardSettings(identity), diff --git a/client/src/settings/settingsUtil.js b/client/src/settings/settingsUtil.js index 0c386241..5e7bb7b7 100644 --- a/client/src/settings/settingsUtil.js +++ b/client/src/settings/settingsUtil.js @@ -9,6 +9,15 @@ export function getLateValue(identity) { return identity?.additionalData?.lateValue || 0.3; } +export function useLessonTimes() { + const { identity } = useGetIdentity(); + return getLessonTimes(identity); +} + +export function getLessonTimes(identity) { + return identity?.additionalData?.lessonTimes || []; +} + export const useDashboardItems = () => { const { identity } = useGetIdentity(); return getDashboardItems(identity); diff --git a/client/src/utils/lessonGaps.js b/client/src/utils/lessonGaps.js new file mode 100644 index 00000000..082f72b6 --- /dev/null +++ b/client/src/utils/lessonGaps.js @@ -0,0 +1,70 @@ +const ISRAEL_TIMEZONE = 'Asia/Jerusalem'; + +const timeToMinutes = (time) => { + const [hours, minutes] = String(time).split(':').map(Number); + return hours * 60 + minutes; +}; + +// Date (YYYY-MM-DD) and minutes since midnight of a timestamp, in Israel time. +const getIsraelDateAndMinutes = (value) => { + const parts = Object.fromEntries( + new Intl.DateTimeFormat('en-CA', { + timeZone: ISRAEL_TIMEZONE, + year: 'numeric', month: '2-digit', day: '2-digit', + hour: '2-digit', minute: '2-digit', hourCycle: 'h23', + }).formatToParts(new Date(value)).map(({ type, value }) => [type, value]) + ); + return { date: `${parts.year}-${parts.month}-${parts.day}`, minutes: Number(parts.hour) * 60 + Number(parts.minute) }; +}; + +const toDateOnly = (value) => String(value).slice(0, 10); + +const getWeekday = (dateOnly) => new Date(`${dateOnly}T00:00:00Z`).getUTCDay(); + +// The day's lessons from the lessonTimes setting, sorted by start time. +export function getDayPeriods(lessonTimes, dateOnly) { + const weekday = getWeekday(dateOnly); + const group = (lessonTimes || []).find((item) => item?.days?.map(Number).includes(weekday)); + return (group?.periods || []) + .filter((period) => period?.start && period?.end) + .map((period) => ({ start: period.start, end: period.end, startMinutes: timeToMinutes(period.start) })) + .sort((a, b) => a.startMinutes - b.startMinutes) + .map((period, index) => ({ ...period, number: index + 1 })); +} + +// A report belongs to the last lesson that started at or before it (a report in the break counts for the lesson before). +// Reports entered on another day than their report date, or before the first lesson, belong to no lesson. +const getPeriodIndex = (row, periods) => { + const { date, minutes } = getIsraelDateAndMinutes(row.reportHour); + if (date !== toDateOnly(row.reportDate)) { + return -1; + } + return periods.findLastIndex((period) => period.startMinutes <= minutes); +}; + +// The class's lessons with an empty slot ({ isGap: true, period, reportDate }) before each reported lesson +// that comes after one or more unreported lessons of the same day. Nothing is added after the last report of the day. +export function withLessonGaps(lessons, lessonTimes) { + if (!lessonTimes?.length) { + return lessons; + } + const result = []; + // Rows are sorted by report time, so a late entry for another date can come in between; track each date separately. + const lastIndexByDate = new Map(); + lessons.forEach((row) => { + const reportDate = toDateOnly(row.reportDate); + const periods = getDayPeriods(lessonTimes, reportDate); + const index = getPeriodIndex(row, periods); + const lastIndex = lastIndexByDate.get(reportDate) ?? -1; + if (index > lastIndex) { + if (lastIndex >= 0) { + periods.slice(lastIndex + 1, index).forEach((period) => { + result.push({ isGap: true, id: `gap_${reportDate}_${period.number}`, reportDate: row.reportDate, period }); + }); + } + lastIndexByDate.set(reportDate, index); + } + result.push(row); + }); + return result; +} diff --git a/client/src/utils/lessonGaps.test.js b/client/src/utils/lessonGaps.test.js new file mode 100644 index 00000000..4eaef633 --- /dev/null +++ b/client/src/utils/lessonGaps.test.js @@ -0,0 +1,83 @@ +import { getDayPeriods, withLessonGaps } from './lessonGaps'; + +// 2026-10-14 is a Wednesday (weekday 3); Israel is UTC+3 on that date. +const lessonTimes = [ + { + days: [0, 1, 2, 3, 4], + periods: [ + { start: '08:00', end: '08:45' }, + { start: '08:45', end: '09:30' }, + { start: '09:45', end: '10:30' }, + { start: '10:30', end: '11:15' }, + { start: '11:15', end: '12:00' }, + ], + }, + { days: [5], periods: [{ start: '08:00', end: '08:45' }] }, +]; + +const lesson = (id, reportHour, reportDate = '2026-10-14') => ({ id, reportDate, reportHour }); + +describe('getDayPeriods', () => { + it('picks the group of the weekday and numbers lessons by start time', () => { + const periods = getDayPeriods([{ days: ['3'], periods: [{ start: '09:00', end: '09:45' }, { start: '08:00', end: '08:45' }] }], '2026-10-14'); + expect(periods.map((period) => [period.number, period.start])).toEqual([[1, '08:00'], [2, '09:00']]); + }); + + it('returns no lessons for a day without a group', () => { + expect(getDayPeriods(lessonTimes, '2026-10-17')).toEqual([]); + }); +}); + +describe('withLessonGaps', () => { + it('returns the lessons unchanged when no lesson times are set', () => { + const lessons = [lesson(1, '2026-10-14T05:10:00Z'), lesson(2, '2026-10-14T08:00:00Z')]; + expect(withLessonGaps(lessons, [])).toBe(lessons); + expect(withLessonGaps(lessons, undefined)).toBe(lessons); + }); + + it('adds an empty slot for each unreported lesson between reported ones', () => { + // 08:10 is lesson 1, 11:20 is lesson 5: lessons 2-4 were skipped. + const result = withLessonGaps([lesson(1, '2026-10-14T05:10:00Z'), lesson(2, '2026-10-14T08:20:00Z')], lessonTimes); + expect(result.map((row) => (row.isGap ? `gap${row.period.number}` : row.id))).toEqual([1, 'gap2', 'gap3', 'gap4', 2]); + }); + + it('counts a report in the break for the lesson before it', () => { + // 09:35 is the break after lesson 2, 09:50 is lesson 3: nothing skipped. + const result = withLessonGaps([lesson(1, '2026-10-14T05:50:00Z'), lesson(2, '2026-10-14T06:35:00Z'), lesson(3, '2026-10-14T06:50:00Z')], lessonTimes); + expect(result.some((row) => row.isGap)).toBe(false); + }); + + it('adds nothing before the first or after the last report of the day', () => { + const result = withLessonGaps([lesson(1, '2026-10-14T06:50:00Z')], lessonTimes); + expect(result).toEqual([lesson(1, '2026-10-14T06:50:00Z')]); + }); + + it('does not add a slot between two reports of the same lesson', () => { + const result = withLessonGaps([lesson(1, '2026-10-14T05:10:00Z'), lesson(2, '2026-10-14T05:30:00Z')], lessonTimes); + expect(result.some((row) => row.isGap)).toBe(false); + }); + + it('ignores reports entered on another day than their report date', () => { + // Report for the 13th entered on the 14th at 11:20 must not open a gap on either day. + const result = withLessonGaps([ + lesson(1, '2026-10-13T05:10:00Z', '2026-10-13'), + lesson(2, '2026-10-14T05:10:00Z'), + lesson(3, '2026-10-14T08:20:00Z', '2026-10-13'), + ], lessonTimes); + expect(result.some((row) => row.isGap)).toBe(false); + }); + + it('tracks each date separately', () => { + const result = withLessonGaps([ + lesson(1, '2026-10-13T05:10:00Z', '2026-10-13'), + lesson(2, '2026-10-14T05:10:00Z'), + lesson(3, '2026-10-14T06:50:00Z'), + ], lessonTimes); + expect(result.map((row) => (row.isGap ? `gap${row.period.number}` : row.id))).toEqual([1, 2, 'gap2', 3]); + }); + + it('accepts report dates serialized as full timestamps', () => { + const result = withLessonGaps([lesson(1, '2026-10-14T05:10:00Z', '2026-10-14T00:00:00.000Z'), lesson(2, '2026-10-14T06:50:00Z', '2026-10-14T00:00:00.000Z')], lessonTimes); + expect(result.filter((row) => row.isGap).map((row) => row.period.number)).toEqual([2]); + }); +}); From 1603ee9bb3458fec346f307c10654bb96c2cd04d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 19:33:18 +0000 Subject: [PATCH 2/4] Skip lesson gaps for other users' classes and ignore malformed lesson times Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0174KSELfDgGPRrqq6ffo7Gw --- client/src/entities/teacher-reported-today.jsx | 6 ++++-- client/src/utils/lessonGaps.js | 7 ++++--- client/src/utils/lessonGaps.test.js | 12 ++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/client/src/entities/teacher-reported-today.jsx b/client/src/entities/teacher-reported-today.jsx index 94abf8b4..80d29bce 100644 --- a/client/src/entities/teacher-reported-today.jsx +++ b/client/src/entities/teacher-reported-today.jsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { DateInput, ReferenceField, RecordContextProvider, TextField, useGetList, useListContext, usePermissions } from 'react-admin'; +import { DateInput, ReferenceField, RecordContextProvider, TextField, useGetIdentity, useGetList, useListContext, usePermissions } from 'react-admin'; import { Box, ButtonBase, Card, CircularProgress, Popover, Typography } from '@mui/material'; import { getResourceComponents } from '@shared/components/crudContainers/CommonEntity'; import { CommonList } from '@shared/components/crudContainers/CommonList'; @@ -198,6 +198,7 @@ const GapRow = ({ gap, showDate }) => ( const TeacherReportCards = ({ isAdmin }) => { const { data, total, filterValues } = useListContext(); const lessonTimes = useLessonTimes(); + const { identity } = useGetIdentity(); const rows = data || []; const klasses = groupByKlass(rows); // Show the date on each row unless the filter is a single day. @@ -237,7 +238,8 @@ const TeacherReportCards = ({ isAdmin }) => { )} - {withLessonGaps(klass.lessons, lessonTimes).map((row) => (row.isGap + {/* Lesson times are the viewer's own setting, so an admin sees no gaps in other users' classes. */} + {(identity && Number(klass.userId) === Number(identity.id) ? withLessonGaps(klass.lessons, lessonTimes) : klass.lessons).map((row) => (row.isGap ? : ))} diff --git a/client/src/utils/lessonGaps.js b/client/src/utils/lessonGaps.js index 082f72b6..6868ee51 100644 --- a/client/src/utils/lessonGaps.js +++ b/client/src/utils/lessonGaps.js @@ -24,8 +24,8 @@ const getWeekday = (dateOnly) => new Date(`${dateOnly}T00:00:00Z`).getUTCDay(); // The day's lessons from the lessonTimes setting, sorted by start time. export function getDayPeriods(lessonTimes, dateOnly) { const weekday = getWeekday(dateOnly); - const group = (lessonTimes || []).find((item) => item?.days?.map(Number).includes(weekday)); - return (group?.periods || []) + const group = lessonTimes.find((item) => Array.isArray(item?.days) && item.days.map(Number).includes(weekday)); + return (Array.isArray(group?.periods) ? group.periods : []) .filter((period) => period?.start && period?.end) .map((period) => ({ start: period.start, end: period.end, startMinutes: timeToMinutes(period.start) })) .sort((a, b) => a.startMinutes - b.startMinutes) @@ -44,8 +44,9 @@ const getPeriodIndex = (row, periods) => { // The class's lessons with an empty slot ({ isGap: true, period, reportDate }) before each reported lesson // that comes after one or more unreported lessons of the same day. Nothing is added after the last report of the day. +// A lesson is placed by the time it was reported, so a report entered late counts for the lesson it was entered in. export function withLessonGaps(lessons, lessonTimes) { - if (!lessonTimes?.length) { + if (!Array.isArray(lessonTimes) || !lessonTimes.length) { return lessons; } const result = []; diff --git a/client/src/utils/lessonGaps.test.js b/client/src/utils/lessonGaps.test.js index 4eaef633..afb25282 100644 --- a/client/src/utils/lessonGaps.test.js +++ b/client/src/utils/lessonGaps.test.js @@ -80,4 +80,16 @@ describe('withLessonGaps', () => { const result = withLessonGaps([lesson(1, '2026-10-14T05:10:00Z', '2026-10-14T00:00:00.000Z'), lesson(2, '2026-10-14T06:50:00Z', '2026-10-14T00:00:00.000Z')], lessonTimes); expect(result.filter((row) => row.isGap).map((row) => row.period.number)).toEqual([2]); }); + + it('places a report entered late by the time it was entered', () => { + // Lesson 1 at 08:10, lesson 3 at 09:55, then lesson 2 reported late at 10:20 counts as lesson 3. + const result = withLessonGaps([lesson(1, '2026-10-14T05:10:00Z'), lesson(2, '2026-10-14T06:55:00Z'), lesson(3, '2026-10-14T07:20:00Z')], lessonTimes); + expect(result.map((row) => (row.isGap ? `gap${row.period.number}` : row.id))).toEqual([1, 'gap2', 2, 3]); + }); + + it('ignores malformed lesson times', () => { + const lessons = [lesson(1, '2026-10-14T05:10:00Z'), lesson(2, '2026-10-14T08:20:00Z')]; + expect(withLessonGaps(lessons, 'bad')).toBe(lessons); + expect(withLessonGaps(lessons, [{ days: '3', periods: 'x' }, null])).toEqual(lessons); + }); }); From 57735e69e258e52b8d08c8f792e1f6493f029e9e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 21:20:02 +0000 Subject: [PATCH 3/4] Skip lesson gaps for admins Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0174KSELfDgGPRrqq6ffo7Gw --- client/src/entities/teacher-reported-today.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/entities/teacher-reported-today.jsx b/client/src/entities/teacher-reported-today.jsx index 80d29bce..1cfc2451 100644 --- a/client/src/entities/teacher-reported-today.jsx +++ b/client/src/entities/teacher-reported-today.jsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { DateInput, ReferenceField, RecordContextProvider, TextField, useGetIdentity, useGetList, useListContext, usePermissions } from 'react-admin'; +import { DateInput, ReferenceField, RecordContextProvider, TextField, useGetList, useListContext, usePermissions } from 'react-admin'; import { Box, ButtonBase, Card, CircularProgress, Popover, Typography } from '@mui/material'; import { getResourceComponents } from '@shared/components/crudContainers/CommonEntity'; import { CommonList } from '@shared/components/crudContainers/CommonList'; @@ -198,7 +198,6 @@ const GapRow = ({ gap, showDate }) => ( const TeacherReportCards = ({ isAdmin }) => { const { data, total, filterValues } = useListContext(); const lessonTimes = useLessonTimes(); - const { identity } = useGetIdentity(); const rows = data || []; const klasses = groupByKlass(rows); // Show the date on each row unless the filter is a single day. @@ -238,8 +237,7 @@ const TeacherReportCards = ({ isAdmin }) => { )} - {/* Lesson times are the viewer's own setting, so an admin sees no gaps in other users' classes. */} - {(identity && Number(klass.userId) === Number(identity.id) ? withLessonGaps(klass.lessons, lessonTimes) : klass.lessons).map((row) => (row.isGap + {(isAdmin ? klass.lessons : withLessonGaps(klass.lessons, lessonTimes)).map((row) => (row.isGap ? : ))} From 3b4a73dd9bee5ac4867627ab8f1725f13b16539e Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 21:20:32 +0000 Subject: [PATCH 4/4] Use TimeInput for lesson times Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_0174KSELfDgGPRrqq6ffo7Gw --- client/src/settings/GeneralSettingsInput.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/settings/GeneralSettingsInput.jsx b/client/src/settings/GeneralSettingsInput.jsx index 4f5a6661..a036e662 100644 --- a/client/src/settings/GeneralSettingsInput.jsx +++ b/client/src/settings/GeneralSettingsInput.jsx @@ -1,10 +1,13 @@ -import { ArrayInput, CheckboxGroupInput, NumberInput, SimpleFormIterator, TextInput, required } from 'react-admin'; +import { ArrayInput, CheckboxGroupInput, NumberInput, SimpleFormIterator, TimeInput, required } from 'react-admin'; import { CommonSettingsAccordion } from '@shared/components/settings/CommonSettingsAccordion'; import CommonAutocompleteInput from '@shared/components/fields/CommonAutocompleteInput'; import { PAGE_SIZE_OPTIONS } from '@shared/config/settings'; const pageSizeOptions = PAGE_SIZE_OPTIONS.map((option) => ({ id: option, name: option })); +// Keep the "HH:mm" string; TimeInput's default parse turns it into a Date. +const parseTime = (value) => value || null; + const weekdayChoices = [ { id: 0, name: 'ראשון' }, { id: 1, name: 'שני' }, @@ -42,8 +45,8 @@ export function GeneralSettingsInput() { - - + +