@@ -10,6 +10,8 @@ import * as TripFormClasses from '@opentripplanner/trip-form/lib/styled'
10
10
11
11
import { setQueryParam } from '../../actions/form'
12
12
13
+ // Styles for the DateTimeSelector.
14
+ // TODO: Find a way to bring OTP CSS classes in here.
13
15
const StyledDateTimeSelector = styled ( DateTimeSelector ) `
14
16
margin: 0 -15px 20px;
15
17
${ TripFormClasses . DateTimeSelector . DateTimeRow } {
@@ -81,21 +83,15 @@ const StyledDateTimeSelector = styled(DateTimeSelector)`
81
83
}
82
84
}
83
85
`
84
- // ^ ^ TODO: On Chrome on MacOS, here is a one-pixel gap between the selection highlight and the control
85
- // that didn't occur in the old version.
86
86
87
87
// Define default routingType labels and components
88
88
const rtDefaults = [
89
89
{
90
90
key : 'ITINERARY' ,
91
- text : 'Itinerary' ,
92
- component : < StyledDateTimeSelector /> ,
93
- componentClass : StyledDateTimeSelector
91
+ text : 'Itinerary'
94
92
} , {
95
93
key : 'PROFILE' ,
96
- text : 'Profile' ,
97
- component : < StyledDateTimeSelector profile /> , // TODO: Profile in DateTimeSelector.
98
- componentClass : StyledDateTimeSelector
94
+ text : 'Profile'
99
95
}
100
96
]
101
97
@@ -107,7 +103,6 @@ class DateTimeModal extends Component {
107
103
108
104
render ( ) {
109
105
const { config, date, dateFormatLegacy, departArrive, routingType, setQueryParam, time, timeFormatLegacy } = this . props
110
- const ActualDateSelector = rtDefaults . find ( d => d . key === routingType ) . componentClass
111
106
112
107
return (
113
108
< div className = 'date-time-modal' >
@@ -135,7 +130,7 @@ class DateTimeModal extends Component {
135
130
136
131
{ /* The main panel for the selected routing type */ }
137
132
< div className = 'main-panel' >
138
- < ActualDateSelector
133
+ < StyledDateTimeSelector
139
134
className = 'date-time-selector'
140
135
date = { date }
141
136
dateFormatLegacy = { dateFormatLegacy }
@@ -157,11 +152,11 @@ const mapStateToProps = (state, ownProps) => {
157
152
departArrive,
158
153
date,
159
154
time,
160
- // startTime, // Not used right now, was once used in "Profile mode".
161
- // endTime, // Not used right now, was once used in "Profile mode".
162
155
routingType,
163
- // These props below are for very old browsers + Safari on MacOS that don't support `<input type="time|date">`.
164
- // Otherwise, `<input type="time|date">` in modern browsers displays the time|date according to user/local settings.
156
+ // These props below are for Safari on MacOS, and old browsers
157
+ // that don't support `<input type="time|date">`.
158
+ // In modern browsers, `<input type="time|date">` already
159
+ // formats the time|date according to the OS settings.
165
160
timeFormatLegacy : getTimeFormat ( state . otp . config ) ,
166
161
dateFormatLegacy : getDateFormat ( state . otp . config )
167
162
}
0 commit comments