react-localized-datetime
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

react-localized-datetime

Usage

First you need to add language provider somewhere into your project

// App.tsx

import { DateTimeLocalizationProvider } from 'react-localized-datetime';

const App = () => (
    <DateTimeLocalizationProvider value="cs-cz">
        {/* children */}
    </DateTimeLocalizationProvider>
);

and then you just wrap the time string in localization component:

import { LocalizedTime, LocalizedDateTime } from 'react-localized-datetime';


const Record = () => (
    <div>
        <LocalizedDateTime>2022-08-11 16:20:00</LocalizedDateTime>
        <span>{/* text */}</span>
    </div>
);

Package Sidebar

Install

npm i react-localized-datetime

Weekly Downloads

6

Version

0.0.11

License

MIT

Unpacked Size

5.5 kB

Total Files

11

Last publish

Collaborators

  • insoftcz