Skip to content

Commit 4ef7869

Browse files
feat: require locale
1 parent 9d69bd4 commit 4ef7869

File tree

8 files changed

+24
-23
lines changed

8 files changed

+24
-23
lines changed

example/src/ReadMeExampleMultiple.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function ReadMeExampleMultiple() {
2424
</Button>
2525

2626
<DatePickerModal
27-
// locale={'en'} optional, default: automatic
27+
locale="en"
2828
mode="multiple"
2929
visible={open}
3030
onDismiss={onDismiss}

example/src/ReadMeExampleRange.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function ReadMeExampleRange() {
2929
Pick range
3030
</Button>
3131
<DatePickerModal
32-
// locale={'en'} optional, default: automatic
32+
locale="en"
3333
mode="range"
3434
visible={open}
3535
onDismiss={onDismiss}

example/src/ReadMeExampleSingle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function ReadMeExampleSingle() {
2424
Pick single date
2525
</Button>
2626
<DatePickerModal
27-
// locale={'en'} optional, default: automatic
27+
locale="en"
2828
mode="single"
2929
visible={open}
3030
onDismiss={onDismissSingle}

src/Date/Calendar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type ValidRangeType = {
2828
}
2929

3030
export type BaseCalendarProps = {
31-
locale?: undefined | string
31+
locale: string
3232
disableWeekDays?: DisableWeekDaysType
3333
validRange?: ValidRangeType
3434

src/Date/CalendarEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function CalendarEdit({
3030
collapsed: boolean
3131
onChange: (s: LocalState) => any
3232
validRange: ValidRangeType | undefined
33-
locale?: undefined | string
33+
locale: string
3434
}) {
3535
const dateInput = React.useRef<TextInputNative | null>(null)
3636
const startInput = React.useRef<TextInputNative | null>(null)

src/Date/DatePickerInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function DatePickerInput(
2222
...rest
2323
}: Omit<React.ComponentProps<typeof TextInput>, 'value' | 'onChange'> & {
2424
inputMode: 'start' | 'end'
25-
locale?: string
25+
locale: string
2626
onChange: (date: Date | undefined) => void
2727
value: Date | undefined
2828
validRange?: ValidRangeType | undefined

src/Date/DatePickerModalContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export type LocalState = {
2828

2929
interface DatePickerModalContentBaseProps {
3030
inputFormat?: string
31-
locale?: undefined | string
31+
locale: string
3232
onDismiss: () => any
3333
disableSafeTop?: boolean
3434
}

src/Date/DateRangeInput.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import * as React from 'react'
22
import { View } from 'react-native'
33
import { Text, IconButton } from 'react-native-paper'
44

5-
import TextInputWithMask from '../TextInputMask'
65
import DatePickerModal from './DatePickerModal'
76

8-
export default function DateRangeInput() {
7+
// WORK IN PROGRESS
8+
export default function DateRangeInput({ locale }: { locale: string }) {
99
const [visible, setVisible] = React.useState<boolean>(false)
1010
const onDismiss = React.useCallback(() => {
1111
setVisible(false)
@@ -22,13 +22,13 @@ export default function DateRangeInput() {
2222
return (
2323
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
2424
<View style={{ flex: 1 }}>
25-
<TextInputWithMask
26-
value={''}
27-
keyboardType={'numeric'}
28-
placeholder={'DD-MM-YYY'}
29-
mask={'DD-MM-YYY'}
30-
onChangeText={() => {}}
31-
/>
25+
{/*<DatePickerInput*/}
26+
{/* value={''}*/}
27+
{/* keyboardType={'numeric'}*/}
28+
{/* placeholder={'DD-MM-YYY'}*/}
29+
{/* mask={'DD-MM-YYY'}*/}
30+
{/* onChangeText={() => {}}*/}
31+
{/*/>*/}
3232
<Text>Van</Text>
3333
</View>
3434
<View>
@@ -40,13 +40,13 @@ export default function DateRangeInput() {
4040
</Text>
4141
</View>
4242
<View style={{ flex: 1 }}>
43-
<TextInputWithMask
44-
value={''}
45-
keyboardType={'numeric'}
46-
placeholder={'DD-MM-YYY'}
47-
mask={'DD-MM-YYY'}
48-
onChangeText={() => {}}
49-
/>
43+
{/*<DatePickerInput*/}
44+
{/* // value={''}*/}
45+
{/* // keyboardType={'numeric'}*/}
46+
{/* // placeholder={'DD-MM-YYY'}*/}
47+
{/* // mask={'DD-MM-YYY'}*/}
48+
{/* // onChangeText={() => {}}*/}
49+
{/*/>*/}
5050
<Text>Tot</Text>
5151
</View>
5252
<View>
@@ -56,6 +56,7 @@ export default function DateRangeInput() {
5656
</Text>
5757
</View>
5858
<DatePickerModal
59+
locale={locale}
5960
mode="range"
6061
visible={visible}
6162
onDismiss={onDismiss}

0 commit comments

Comments
 (0)