Skip to content

Commit 8d73b82

Browse files
committed
remove course times from course search rows
1 parent db55ddd commit 8d73b82

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

source/views/sis/course-search/row.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ import {StyleSheet} from 'react-native'
55
import type {CourseType} from '../../../lib/course-search/types'
66
import {ListRow, Title, Detail} from '@frogpond/lists'
77
import {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'
128
import {Row} from '@frogpond/layout'
13-
const CENTRAL_TZ = 'America/Winnipeg'
14-
const fmt = 'h:mm A'
159

1610
type 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

Comments
 (0)