@@ -15,6 +15,7 @@ import {
1515 Inject ,
1616 RowInfo
1717} from '@syncfusion/ej2-react-grids' ;
18+ import './EmployeeLeave.css' ;
1819import { ChangeEventArgs , SwitchComponent } from '@syncfusion/ej2-react-buttons' ;
1920import { DataManager , Query , UrlAdaptor , Predicate } from '@syncfusion/ej2-data' ;
2021import {
@@ -53,21 +54,51 @@ const Presets = (props: { dateRangeChange: (args: RangeEventArgs) => void }) =>
5354 const lastSixEnd : Date = new Date (
5455 new Date ( new Date ( new Date ( ) . setMonth ( new Date ( ) . getMonth ( ) + 1 ) ) . setDate ( 0 ) ) . toDateString ( )
5556 ) ;
57+ const dateRangePickerRef = React . useRef < DateRangePickerComponent > ( null ) ;
5658
5759 return (
58- < DateRangePickerComponent
59- placeholder = "Select a range"
60- value = { [ yearStart , yearEnd ] }
61- change = { props . dateRangeChange }
62- width = { 190 }
63- >
64- < PresetsDirective >
65- < PresetDirective label = "This Month" start = { monthStart } end = { monthEnd } > </ PresetDirective >
66- < PresetDirective label = "Last Month" start = { lastStart } end = { lastEnd } > </ PresetDirective >
67- < PresetDirective label = "Last 6 Months" start = { lastSixStart } end = { lastSixEnd } > </ PresetDirective >
68- < PresetDirective label = "This Year" start = { yearStart } end = { yearEnd } > </ PresetDirective >
69- </ PresetsDirective >
70- </ DateRangePickerComponent >
60+ < div className = "drp-input-wrapper" >
61+ { /* left calendar icon (overlay) - opens the picker */ }
62+ < button
63+ type = "button"
64+ className = "drp-icon-left"
65+ aria-hidden
66+ onClick = { ( ) => dateRangePickerRef . current && ( dateRangePickerRef . current as any ) . show ( ) }
67+ >
68+ { /* Syncfusion icon (e-icons) for calendar */ }
69+ < span className = "e-input-group-icon e-range-icon e-icons" aria-hidden = "true" > </ span >
70+ </ button >
71+
72+ < DateRangePickerComponent
73+ ref = { dateRangePickerRef }
74+ placeholder = "Select a range"
75+ value = { [ yearStart , yearEnd ] }
76+ format = { 'MMM d, yyyy' }
77+ change = { props . dateRangeChange }
78+ width = { 240 }
79+ cssClass = "custom-syncfusion-drp drp-left-icon"
80+ showClearButton = { false }
81+ >
82+ < PresetsDirective >
83+ < PresetDirective label = "This Month" start = { monthStart } end = { monthEnd } > </ PresetDirective >
84+ < PresetDirective label = "Last Month" start = { lastStart } end = { lastEnd } > </ PresetDirective >
85+ < PresetDirective label = "Last 6 Months" start = { lastSixStart } end = { lastSixEnd } > </ PresetDirective >
86+ < PresetDirective label = "This Year" start = { yearStart } end = { yearEnd } > </ PresetDirective >
87+ </ PresetsDirective >
88+ </ DateRangePickerComponent >
89+
90+
91+
92+ { /* right caret icon (overlay) - also opens the picker */ }
93+ < button
94+ type = "button"
95+ className = "drp-caret-right"
96+ aria-hidden
97+ onClick = { ( ) => dateRangePickerRef . current && ( dateRangePickerRef . current as any ) . show ( ) }
98+ >
99+ < span className = "e-icons e-chevron-down caret-i" aria-hidden = "true" > </ span >
100+ </ button >
101+ </ div >
71102 ) ;
72103} ;
73104
@@ -247,8 +278,8 @@ const EmployeeLeave = (props: { employeeData: EmployeeDetails; userInfo: Employe
247278 actionComplete = { actionComplete }
248279 >
249280 < ColumnsDirective >
250- < ColumnDirective field = "EmployeeCode" headerText = "Code " visible = { false } width = "120" />
251- < ColumnDirective field = "AttendanceID" headerText = "Task ID" isPrimaryKey = { true } width = "140" />
281+ < ColumnDirective field = "EmployeeCode" headerText = "ID " visible = { false } width = "120" />
282+ < ColumnDirective field = "AttendanceID" headerText = "Leave ID" isPrimaryKey = { true } width = "140" />
252283 < ColumnDirective field = "AbsenceType" headerText = "Leave Type" width = "120" />
253284 < ColumnDirective field = "ShiftName" headerText = "Shift Name" width = "120" />
254285 < ColumnDirective field = "From" type = "date" format = "d MMM yyyy" textAlign = "Right" width = "120" />
0 commit comments