react-native-date-i18n
v1.1.0
Published
A React Native library to handle localizing date objects to the user's device settings
Downloads
19
Readme
react-native-date-i18n
A React Native library to handle localizing date objects to the user's device settings
Installation
# Using yarn
yarn add react-native-date-i18n
# Using npm
npm install react-native-date-i18nUsage
import {
DateType,
formatDate,
formatTime,
formatDateTime,
formatAbbreviatedShortDate,
formatAbbreviatedShortDateRange,
formatAbbreviatedShortTime,
formatAbbreviatedShortTimeRange
} from 'react-native-date-i18n';
formatDate(testDate, DateType.long);
formatTime(testDate, DateType.medium);
formatDateTime(testDate, DateType.full, DateType.short);
formatAbbreviatedShortDate(testDate);
formatAbbreviatedShortDateRange(testDate, testDate2);
formatAbbreviatedShortTime(testDate);
formatAbbreviatedShortTimeRange(testDate, testDate2);The DateType options map onto values of the same names across both operating systems:
Screenshots
Contributing
License
MIT
Made with create-react-native-library
