vue-hijri-calendar
v0.1.0
Published
A Vue.js library for displaying Hijri, Gregorian, and Umm al-Qura calendars.
Readme
Vue Hijri Calendar
A Vue.js library for displaying Hijri, Gregorian, and Umm al-Qura calendars.
Features
- Display Hijri and Gregorian calendars
- Support for Umm al-Qura dates
- Easy to use and customize
- Lightweight and responsive design
Installation
You can install the library via npm:
npm install vue-hijri-calendarUsage
Global Registration
Register the component globally in your Vue application:
import Vue from 'vue';
import VueHijriCalendar from 'vue-hijri-calendar';
import 'vue-hijri-calendar/dist/style.css'; // Import the CSS file
Vue.use(VueHijriCalendar);Local Registration
Use the component locally in your Vue component:
import VueHijriCalendar from 'vue-hijri-calendar';
import 'vue-hijri-calendar/dist/style.css'; // Import the CSS file
export default {
components: {
VueHijriCalendar,
},
};Example
<template>
<div>
<vue-hijri-calendar
type="hijri" <!-- or 'gregorian' -->
@date-selected="handleDateSelect"
/>
</div>
</template>
<script>
export default {
methods: {
handleDateSelect(date) {
console.log('Selected Date:', date);
},
},
};
</script>Props
| Prop Name | Type | Default | Description | |-----------|--------|-------------|-----------------------------------| | type | String | 'gregorian' | Calendar type ('gregorian' or 'hijri') |
Events
| Event Name | Description | |--------------|----------------------------------| | date-selected | Emitted when a date is selected. |
Building the Library
To build the library locally, follow these steps:
Clone the repository:
git clone https://github.com/your-repo/vue-hijri-calendar.git
cd vue-hijri-calendarInstall dependencies:
npm installBuild the library:
npm run buildThe build files will be generated in the dist/ folder.
Publishing to npm
To publish the library to npm, follow these steps:
Make sure you have an npm account. If not, sign up at npmjs.com.
Log in to your npm account:
npm loginUpdate the
versionfield inpackage.jsonif needed.Publish the package:
npm publish
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
