Overview
Akidate provides a streamlined and uniform interface for handling dates and times in JavaScript applications, offering a more convenient and efficient way to manage date-related functionalities.
How It Works
The Akidate module exports akidate object, providing a consistent interface
for date operations.
Syntax
import { akidate } from '@akinon/akidate';i18n
Akidate has great support for internationalization. But none of them will be included in your build unless you use it.
akidate.setLocale('es'); // use Spanish locale globallyAvailable locales
| locale | Language |
|---|---|
ar | Arabic |
es | Spanish |
fr | French |
de | German |
pt | Portuguese |
ru | Russian |
en | English |
tr | Türkçe |
Usage Example
Here’s an example of how to use the Akidate module:
import { akidate } from '@akinon/akidate';
const MyComponent = () => {
const formattedDate = akidate.formatIsoDate(
new Date('2024-09-19').toISOString(),
'DD.MM.YYYY HH:mm:ss'
);
return (
<div>
<p>Current Date: {formattedDate}</p>
</div>
);
};
export default MyComponent;