@e4ia/datetime
v0.1.18
Published
A utility package for handling date and time in React projects.
Downloads
13
Keywords
Readme
🌟 @e4ia/datetime 🌟
App: E4LINK-Dashboard
A lightweight utility package for handling date and time in React projects, powered by the awesome date-fns library. 🕒📆
📦 Installation
Install the package and its peer dependencies using npm or yarn:
npm install @e4ia/datetime date-fns react react-dom
or
yarn add @e4ia/datetime date-fns react react-dom
🚀 Features
- 🕰️ Easy-to-use date and time utilities for React.
- 📅 Seamless integration with the
date-fnslibrary. - 🧩 Lightweight and efficient.
- 🔧 Compatible with React 16.8+.
🛠️ Usage
Here’s how you can start using @e4ia/datetime in your project:
import { formatDate } from '@e4ia/datetime';
const App = () => { const date = new Date(); const formattedDate = formatDate(date, 'yyyy-MM-dd');
return 📅 Today’s Date: {formattedDate}; };
export default App;
📚 API
formatDate(date, format)
Formats a date using a specified format string.
date: The date to format (e.g.,new Date()).format: Adate-fns-compatible format string (e.g.,'yyyy-MM-dd').
Other Utilities
Check out the full list of utilities in the documentation.
📋 Peer Dependencies
Make sure you have these installed:
date-fns: ^2.28.0react: ^16.8.0 || ^17.0.0react-dom: ^16.8.0 || ^17.0.0
🛡️ License
This package is licensed under SEE LICENSE IN LICENSE. 📝
🙌 Contributing
We welcome contributions! Feel free to submit issues or pull requests. 🚀
❤️ Support
If you find this package useful, please ⭐ the repository! Happy coding! 🎉
