import { getDates } from 'src/utils/date' import { shortName } from 'src/models/collective' const now = new Date() const dates = getDates(now) const isToday = weekDayIndex => (now.getDay() - 1) === weekDayIndex const weekDay = weekDayIndex => dates[weekDayIndex] const short = shortName const todayClass = i => isToday(i) ? 'current' : '' const HeadDay = ({ i, children }) => (
{children}
{weekDay(i)}
{name}
{time}
{url ? ( {title} ) : ( {title} ) }
) const Teacher = ({ name, url }) => ({url ? ( {short(name)} ) : ( {short(name)} ) }
) const TimeRange = ({ range }) => ({(range || []).join(' — ')}
)