Skip to main content

DateTime

DateTime component provides ability to format values of Date. Full list of supported properties you can find on MDN page

To use this component, you need to import the component as the followings:

React#

import { DateTime } from '@eo-locale/react';

Preact#

import { DateTime } from '@eo-locale/preact';

React Native#

import { DateTime } from '@eo-locale/react-native';

And add into your application like this:

export function SomeComponent() {
return (
<DateTime
language={appLanguage}
value={new Date()}
day="numeric"
month="long"
weekday="long"
year="numeric"
/>
);
}

As above example, component will display Tuesday, April 20, 2021  
Choose your language:Â