@@ -4,8 +4,8 @@ import { TimelineStateConsumer } from '../timeline/TimelineStateContext'
44import CustomHeader from './CustomHeader'
55import { getNextUnit } from '../utility/calendar'
66import { defaultHeaderFormats } from '../default-config'
7- import Interval from './Interval'
87import memoize from 'memoize-one'
8+ import { CustomDateHeader } from './CustomDateHeader'
99
1010class DateHeader extends React . Component {
1111 static propTypes = {
@@ -86,7 +86,7 @@ class DateHeader extends React.Component {
8686 this . props . unit ,
8787 this . props . headerData
8888 ) }
89- children = { Header }
89+ children = { CustomDateHeader }
9090 />
9191 )
9292 }
@@ -143,50 +143,6 @@ class DateHeaderWrapper extends React.Component {
143143 }
144144}
145145
146- function Header ( {
147- headerContext : { intervals, unit } ,
148- getRootProps,
149- getIntervalProps,
150- showPeriod,
151- data : {
152- style,
153- intervalRenderer,
154- className,
155- getLabelFormat,
156- unitProp,
157- ...restData
158- }
159- } ) {
160- return (
161- < div
162- data-testid = { `dateHeader` }
163- className = { className }
164- { ...getRootProps ( { style } ) }
165- >
166- { intervals . map ( interval => {
167- const intervalText = getLabelFormat (
168- [ interval . startTime , interval . endTime ] ,
169- unit ,
170- interval . labelWidth
171- )
172- return (
173- < Interval
174- key = { `label-${ interval . startTime . valueOf ( ) } ` }
175- unit = { unit }
176- interval = { interval }
177- showPeriod = { showPeriod }
178- intervalText = { intervalText }
179- primaryHeader = { unitProp === 'primaryHeader' }
180- getIntervalProps = { getIntervalProps }
181- intervalRenderer = { intervalRenderer }
182- headerData = { restData }
183- />
184- )
185- } ) }
186- </ div >
187- )
188- }
189-
190146function formatLabel (
191147 [ timeStart , timeEnd ] ,
192148 unit ,
0 commit comments