forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/dev-2.x' into arrive-by-filtering
- Loading branch information
Showing
52 changed files
with
1,454 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
VITE_API_URL=http://localhost:8080/otp/transmodel/v3 | ||
VITE_DEBUG_STYLE_URL=http://localhost:8080/otp/routers/default/inspector/vectortile/style.json | ||
VITE_GRAPHIQL_URL=http://localhost:8080/graphiql?flavor=transmodel | ||
VITE_GRAPHIQL_URL=http://localhost:8080/graphiql?flavor=transmodel |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { Form } from 'react-bootstrap'; | ||
import { TripQueryVariables } from '../../gql/graphql.ts'; | ||
import { ChangeEvent, useCallback, useContext } from 'react'; | ||
import { Temporal } from '@js-temporal/polyfill'; | ||
import { TimeZoneContext } from '../../hooks/TimeZoneContext.ts'; | ||
|
||
export function DateTimeInputField({ | ||
tripQueryVariables, | ||
setTripQueryVariables, | ||
}: { | ||
tripQueryVariables: TripQueryVariables; | ||
setTripQueryVariables: (tripQueryVariables: TripQueryVariables) => void; | ||
}) { | ||
const timeZone = useContext(TimeZoneContext); | ||
const current = Temporal.Instant.from(tripQueryVariables.dateTime) | ||
.toZonedDateTimeISO(timeZone) | ||
.toPlainDateTime() | ||
.toString({ smallestUnit: 'minute', calendarName: 'never' }); | ||
|
||
const onChange = useCallback( | ||
(event: ChangeEvent<HTMLInputElement>) => { | ||
const dateTime = Temporal.PlainDateTime.from(event.target.value) | ||
.toZonedDateTime(timeZone) | ||
.toString({ calendarName: 'never', timeZoneName: 'never' }); | ||
|
||
setTripQueryVariables({ | ||
...tripQueryVariables, | ||
dateTime: dateTime, | ||
}); | ||
}, | ||
[tripQueryVariables, setTripQueryVariables, timeZone], | ||
); | ||
|
||
return ( | ||
<Form.Group> | ||
<Form.Label column="sm" htmlFor="timePicker" title={'Time zone: ' + timeZone}> | ||
Time | ||
</Form.Label> | ||
<Form.Control type="datetime-local" id="timePicker" size="sm" onChange={onChange} value={current} /> | ||
</Form.Group> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { createContext } from 'react'; | ||
|
||
export const TimeZoneContext = createContext('UTC'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.