@@ -203,26 +203,86 @@ function EDailyActivityLog(props) {
203203
204204 return (
205205 < div className = { `container-fluid ${ styles . mainContainer } ${ darkMode ? styles . darkMode : '' } ` } >
206+ { /* These styles are required for the Date Picker to work in Dark Mode */ }
207+ { darkMode && (
208+ < style > { `
209+ .dark-table-row:hover,
210+ thead.table-dark tr.text-light:hover,
211+ tr.select-project-row.dark-mode:hover {
212+ background-color: #222 !important;
213+ color: #fff !important;
214+ transition: background-color 0.2s;
215+ }
216+ .dark-date-input {
217+ background-color: #343a40 !important;
218+ color: #f8f9fa !important;
219+ border-color: #495057 !important;
220+ }
221+ .dark-date-input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }
222+ .dark-date-input::-webkit-datetime-edit { color: #f8f9fa; }
223+ .dark-date-input::-webkit-datetime-edit-fields-wrapper { color: #f8f9fa; }
224+ .dark-date-input::-webkit-datetime-edit-text { color: #f8f9fa; }
225+ .dark-date-input::-webkit-datetime-edit-month-field,
226+ .dark-date-input::-webkit-datetime-edit-day-field,
227+ .dark-date-input::-webkit-datetime-edit-year-field { color: #f8f9fa; }
228+ .dark-date-input[type="date"] { color-scheme: dark; }
229+ @supports (-webkit-appearance: none) or (-moz-appearance: none) {
230+ .dark-date-input { color-scheme: dark; }
231+ }
232+ ` } </ style >
233+ ) }
234+
235+ { ! darkMode && (
236+ < style > { `
237+ .light-date-input {
238+ background-color: #fff !important;
239+ color: #000 !important;
240+ border-color: #ced4da !important;
241+ }
242+ .light-date-input::-webkit-calendar-picker-indicator { filter: invert(0); }
243+ .light-date-input[type="date"] { color-scheme: light; }
244+ ` } </ style >
245+ ) }
246+
206247 < div className = "container" >
207248 < h4 className = "mb-4 pt-3" > Daily Equipment Log</ h4 >
208249
209250 { /* Header Row */ }
210251 < div className = "row mb-3 align-items-end" >
211252 < div className = "col-md-3" >
212- < label className = "form-label fw-bold" htmlFor = "date" >
253+ < label
254+ className = { `form-label fw-bold${ darkMode ? ' text-light' : '' } ` }
255+ htmlFor = "date"
256+ style = { darkMode ? { color : '#f8f9fa' } : { } }
257+ >
213258 Date
214259 </ label >
215260 < input
216261 type = "date"
217262 id = "date"
218- className = " form-control"
263+ className = { ` form-control ${ darkMode ? 'dark-date-input' : 'light-date-input' } ` }
219264 value = { date }
265+ min = { getToday ( ) }
220266 onChange = { e => setDate ( e . target . value ) }
267+ style = {
268+ darkMode
269+ ? { backgroundColor : '#343a40' , color : '#f8f9fa' , borderColor : '#495057' }
270+ : { }
271+ }
221272 />
273+ { darkMode && (
274+ < small className = "text-muted mt-1 d-block" >
275+ Note: Calendar appearance depends on your browser and OS.
276+ </ small >
277+ ) }
222278 </ div >
223279
224280 < div className = "col-md-5" >
225- < label className = "form-label fw-bold" htmlFor = "project-select" >
281+ < label
282+ className = { `form-label fw-bold${ darkMode ? ' text-light' : '' } ` }
283+ htmlFor = "project-select"
284+ style = { darkMode ? { color : '#f8f9fa' } : { } }
285+ >
226286 Project
227287 </ label >
228288 < Select
@@ -354,7 +414,6 @@ function EDailyActivityLog(props) {
354414 </ div >
355415 ) ;
356416}
357-
358417const mapStateToProps = state => ( {
359418 auth : state . auth ,
360419 darkMode : state . theme . darkMode ,
0 commit comments