-
Notifications
You must be signed in to change notification settings - Fork 957
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components): date-service - add ability to specify date format
- Loading branch information
1 parent
8b33c91
commit 705dc97
Showing
6 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/showcases/components/datepicker/datepickerDateFormat.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import { | ||
Datepicker, | ||
Layout, | ||
NativeDateService, | ||
} from '@ui-kitten/components'; | ||
|
||
const dateService = new NativeDateService('en', { format: 'DD.MM.YYYY' }); | ||
|
||
export const DatepickerDateFormatShowcase = () => { | ||
|
||
const [selectedDate, setSelectedDate] = React.useState(null); | ||
|
||
return ( | ||
<Layout style={styles.container}> | ||
<Datepicker | ||
placeholder='Pick Date' | ||
date={selectedDate} | ||
onSelect={setSelectedDate} | ||
dateService={dateService} | ||
/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
minHeight: 376, | ||
}, | ||
}); |