-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
front: handle train schedule with times exceeding midnight
- Loading branch information
1 parent
bedee08
commit 0bcffcd
Showing
26 changed files
with
820 additions
and
160 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { CellProps } from 'react-datasheet-grid/dist/types'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { NO_BREAK_SPACE } from 'utils/strings'; | ||
|
||
import type { TimeExtraDays } from './types'; | ||
|
||
type ReadOnlyTimeProps = CellProps<TimeExtraDays | undefined | undefined, string>; | ||
|
||
const ReadOnlyTime = ({ rowData }: ReadOnlyTimeProps) => { | ||
const { t } = useTranslation('timesStops'); | ||
const { time, daySinceDeparture, dayDisplayed } = rowData || {}; | ||
if (time) { | ||
const fullString = | ||
daySinceDeparture !== undefined && dayDisplayed | ||
? `${time}${NO_BREAK_SPACE}${t('d+')}${daySinceDeparture}` | ||
: time; | ||
return <div className="read-only-time">{fullString}</div>; | ||
} | ||
return null; | ||
}; | ||
|
||
ReadOnlyTime.displayName = 'ReadOnlyTime'; | ||
|
||
export default ReadOnlyTime; |
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.