@@ -4,15 +4,16 @@ import XDate from 'xdate';
44import { Map } from 'immutable' ;
55
66import React , { Component } from 'react' ;
7- import { FlatList , View , Text , NativeSyntheticEvent , NativeScrollEvent } from 'react-native' ;
7+ import { FlatList , View , NativeSyntheticEvent , NativeScrollEvent } from 'react-native' ;
88
99import { extractComponentProps } from '../../componentUpdater' ;
10- import { weekDayNames , sameWeek } from '../../dateutils' ;
10+ import { sameWeek } from '../../dateutils' ;
1111import { toMarkingFormat } from '../../interface' ;
1212import { DateData } from '../../types' ;
1313import styleConstructor from '../style' ;
1414import asCalendarConsumer from '../asCalendarConsumer' ;
1515import CalendarList , { CalendarListProps } from '../../calendar-list' ;
16+ import WeekDaysNames from '../../commons/WeekDaysNames' ;
1617import Week from '../week' ;
1718import Presenter from './presenter' ;
1819import constants from '../../commons/constants' ;
@@ -168,26 +169,18 @@ class WeekCalendar extends Component<WeekCalendarProps, State> {
168169
169170 keyExtractor = ( _ : string , index : number ) => index . toString ( ) ;
170171
171- renderWeekDaysNames = memoize ( weekDaysNames => {
172- return weekDaysNames . map ( ( day : string , index : number ) => (
173- < Text
174- allowFontScaling = { false }
175- key = { index }
176- style = { this . style . dayHeader }
177- numberOfLines = { 1 }
178- accessibilityLabel = { '' }
179- // accessible={false} // not working
180- // importantForAccessibility='no'
181- >
182- { day }
183- </ Text >
184- ) ) ;
185- } ) ;
172+ renderWeekDaysNames = ( ) => {
173+ return (
174+ < WeekDaysNames
175+ firstDay = { this . props . firstDay }
176+ style = { this . style . dayHeader }
177+ />
178+ ) ;
179+ } ;
186180
187181 render ( ) {
188182 const { allowShadow, firstDay, hideDayNames, current, context} = this . props ;
189183 const { items} = this . state ;
190- const weekDaysNames = weekDayNames ( firstDay ) ;
191184 const extraData = Map ( {
192185 current,
193186 date : context . date ,
@@ -202,7 +195,7 @@ class WeekCalendar extends Component<WeekCalendarProps, State> {
202195 { ! hideDayNames && (
203196 < View style = { [ this . style . week , this . style . weekCalendar ] } >
204197 { /* {this.props.weekNumbers && <Text allowFontScaling={false} style={this.style.dayHeader}></Text> } */ }
205- { this . renderWeekDaysNames ( weekDaysNames ) }
198+ { this . renderWeekDaysNames ( ) }
206199 </ View >
207200 ) }
208201 < FlatList
0 commit comments