@@ -5,13 +5,7 @@ import {StyleSheet} from 'react-native'
55import type { CourseType } from '../../../lib/course-search/types'
66import { ListRow , Title , Detail } from '@frogpond/lists'
77import { deptNum } from './lib/format-dept-num'
8- import moment from 'moment-timezone'
9- import { convertTimeStringsToOfferings } from 'sto-sis-time-parser'
10- import { formatDayAbbrev } from './lib/format-day'
11- import sortBy from 'lodash/sortBy'
128import { Row } from '@frogpond/layout'
13- const CENTRAL_TZ = 'America/Winnipeg'
14- const fmt = 'h:mm A'
159
1610type Props = {
1711 course : CourseType ,
@@ -25,24 +19,6 @@ export class CourseRow extends React.PureComponent<Props> {
2519
2620 render ( ) {
2721 const { course } = this . props
28- const groupings = convertTimeStringsToOfferings ( course , { groupBy : 'sis' } )
29- const formattedGroupings = groupings . map ( grouping => {
30- const times = grouping . times
31- . map ( time => {
32- const start = moment . tz ( time . start , 'hmm' , CENTRAL_TZ ) . format ( fmt )
33- const end = moment . tz ( time . end , 'hmm' , CENTRAL_TZ ) . format ( fmt )
34- return `${ start } – ${ end } `
35- } )
36- . join ( ', ' )
37- const dayOrder = [ 'Mo' , 'Tu' , 'We' , 'Th' , 'Fr' ]
38- let days = sortBy ( grouping . days , d => dayOrder . indexOf ( d ) )
39- . map ( formatDayAbbrev )
40- . join ( '' )
41- if ( days === 'MTWThF' ) {
42- days = 'M-F'
43- }
44- return `${ days } ${ times } `
45- } )
4622
4723 return (
4824 < ListRow arrowPosition = "center" onPress = { this . onPress } >
@@ -60,8 +36,6 @@ export class CourseRow extends React.PureComponent<Props> {
6036 < Detail style = { styles . row } > { course . instructors . join ( ', ' ) } </ Detail >
6137 ) }
6238
63- { course . times && < Detail > { formattedGroupings . join ( '\n' ) } </ Detail > }
64-
6539 { course . notes && (
6640 < Detail lines = { 1 } style = { [ styles . italics , styles . row ] } >
6741 { course . notes . join ( ' ' ) }
0 commit comments