File tree 4 files changed +30
-48
lines changed
src/components/events/partials
4 files changed +30
-48
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ import { Recording } from "../../../../slices/recordingSlice";
47
47
import { useTranslation } from "react-i18next" ;
48
48
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons" ;
49
49
import SchedulingTime from "../wizards/scheduling/SchedulingTime" ;
50
- import SchedulingEndDateDisplay from "../wizards/scheduling/SchedulingEndDateDisplay" ;
51
50
import SchedulingLocation from "../wizards/scheduling/SchedulingLocation" ;
52
51
import SchedulingInputs from "../wizards/scheduling/SchedulingInputs" ;
53
52
import SchedulingConflicts from "../wizards/scheduling/SchedulingConflicts" ;
@@ -410,16 +409,15 @@ const EventDetailsSchedulingTab = ({
410
409
checkConflictsWrapper
411
410
)
412
411
} }
412
+ date = {
413
+ hasAccessRole &&
414
+ ( new Date ( formik . values . scheduleEndDate ) . getDate ( ) !==
415
+ new Date ( formik . values . scheduleStartDate ) . getDate ( ) )
416
+ ? formik . values . scheduleEndDate
417
+ : undefined
418
+ }
413
419
/>
414
420
) }
415
- { hasAccessRole &&
416
- formik . values . scheduleEndDate . toString ( ) !==
417
- formik . values . scheduleStartDate . toString ( ) && (
418
- < SchedulingEndDateDisplay
419
- scheduleEndDate = { formik . values . scheduleEndDate }
420
- />
421
- )
422
- }
423
421
{ ! hasAccessRole && (
424
422
< tr >
425
423
< td >
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ import { parseISO } from "date-fns";
42
42
import WizardNavigationButtons from "../../../shared/wizard/WizardNavigationButtons" ;
43
43
import { checkConflicts , UploadAssetsTrack } from "../../../../slices/eventSlice" ;
44
44
import SchedulingTime from "../wizards/scheduling/SchedulingTime" ;
45
- import SchedulingEndDateDisplay from "../wizards/scheduling/SchedulingEndDateDisplay" ;
46
45
import SchedulingLocation from "../wizards/scheduling/SchedulingLocation" ;
47
46
import SchedulingInputs from "../wizards/scheduling/SchedulingInputs" ;
48
47
import SchedulingConflicts from "../wizards/scheduling/SchedulingConflicts" ;
@@ -601,17 +600,15 @@ const Schedule = <T extends {
601
600
) ;
602
601
}
603
602
} }
603
+ date = {
604
+ formik . values . sourceMode === "SCHEDULE_SINGLE" &&
605
+ ( new Date ( formik . values . scheduleEndDate ) . getDate ( ) !==
606
+ new Date ( formik . values . scheduleStartDate ) . getDate ( ) )
607
+ ? formik . values . scheduleEndDate
608
+ : undefined
609
+ }
604
610
/>
605
611
606
- { /* display end date if on different day to start date, only if this is current source mode */ }
607
- { formik . values . sourceMode === "SCHEDULE_SINGLE" &&
608
- formik . values . scheduleEndDate . toString ( ) !==
609
- formik . values . scheduleStartDate . toString ( ) && (
610
- < SchedulingEndDateDisplay
611
- scheduleEndDate = { formik . values . scheduleEndDate }
612
- />
613
- ) }
614
-
615
612
< SchedulingLocation
616
613
location = { formik . values . location }
617
614
inputDevices = { inputDevices }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
3
3
import DropDown from "../../../../shared/DropDown" ;
4
4
import { hours , minutes } from "../../../../../configs/modalConfig" ;
5
5
import { formatTimeForDropdown } from "../../../../../utils/dropDownUtils" ;
6
+ import { getCurrentLanguageInformation } from "../../../../../utils/utils" ;
6
7
7
8
const SchedulingTime = ( {
8
9
hour,
@@ -12,7 +13,8 @@ const SchedulingTime = ({
12
13
hourPlaceholder,
13
14
minutePlaceholder,
14
15
callbackHour,
15
- callbackMinute
16
+ callbackMinute,
17
+ date
16
18
} : {
17
19
hour : string ,
18
20
minute : string ,
@@ -22,8 +24,11 @@ const SchedulingTime = ({
22
24
minutePlaceholder : string
23
25
callbackHour : ( value : string ) => void
24
26
callbackMinute : ( value : string ) => void
27
+ date ?: string | Date
25
28
} ) => {
26
29
const { t } = useTranslation ( ) ;
30
+ // Get info about the current language and its date locale
31
+ const currentLanguage = getCurrentLanguageInformation ( ) ;
27
32
28
33
return (
29
34
< tr >
@@ -64,6 +69,16 @@ const SchedulingTime = ({
64
69
disabled = { disabled }
65
70
customCSS = { { width : 70 } }
66
71
/>
72
+
73
+ { /* Displays given date. Can be used to signify which date the
74
+ scheduling time belong to*/ }
75
+ { date &&
76
+ < span style = { { marginLeft : "10px" } } >
77
+ { new Date ( date ) . toLocaleDateString (
78
+ currentLanguage ? currentLanguage . dateLocale . code : undefined
79
+ ) }
80
+ </ span >
81
+ }
67
82
</ td >
68
83
</ tr >
69
84
)
You can’t perform that action at this time.
0 commit comments