Skip to content

Commit 32b7918

Browse files
committed
Init
1 parent 1d4ea35 commit 32b7918

File tree

79 files changed

+40736
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+40736
-3
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = crlf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = false
9+
max_line_length = 120
10+
tab_width = 4
11+
ij_continuation_indent_size = 0
12+
ij_formatter_off_tag = @formatter:off
13+
ij_formatter_on_tag = @formatter:on
14+
ij_formatter_tags_enabled = false
15+
ij_smart_tabs = false
16+
ij_visual_guides = none
17+
ij_wrap_on_typing = false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lerna-debug.log*
99
# Diagnostic reports (https://nodejs.org/api/report.html)
1010
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1111

12-
# Runtime data
12+
# Runtime events
1313
pids
1414
*.pid
1515
*.seed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/NIRPersianCalendar.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 155 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,155 @@
1-
# NIRPersianCalendar
2-
Persian calendar with Iran's official holidays and Iranian calendar events and Islamic and world events. And also support for Hijri and Gregorian dates in Vue
1+
<p align="center">
2+
<img src="./docs/docs/.vuepress/public/logo.svg" alt="Vue Persian Calendar | Persian Date Picker" title="Vue Persian Calendar | Persian Date Picker" width="120" />
3+
</p>
4+
5+
<h1 align="center">Vue Persian Calendar</h1>
6+
7+
<p align="center" width="300px">
8+
A comprehensive Vue 3 calendar and date picker component with support for Persian (Jalali), Hijri (Islamic), and Gregorian calendars
9+
</p>
10+
11+
<br/>
12+
13+
This is a Vue 3 component library providing full-featured calendar and date picker components with automatic conversions between three calendar systems. Display and select dates across Persian (Jalali), Hijri (Islamic), and Gregorian calendars simultaneously with comprehensive event management, smart theming, and extensive customization options.
14+
15+
Visualize date selection directly on the calendar using mouse interaction or programmatic control. The component includes over 300 Persian holidays and observances, Islamic religious events, and international world days with smart event indicators and detailed tooltips.
16+
17+
# Features
18+
19+
- **Triple Calendar System** - Display Persian (Jalali), Hijri (Islamic), and Gregorian dates with automatic conversions
20+
- **Comprehensive Events** - 300+ Persian holidays, Islamic events, and international observances with visual indicators
21+
- **Two Component Options** - Full calendar view or compact datepicker with popup
22+
- **Advanced Theming** - Light, dark, or auto-detection with per-color customization
23+
- **Date Range Control** - Restrict selectable dates with `from` and `to` props
24+
- **Accurate Conversions** - Precise Hijri conversion using lookup tables (1427-1464 AH)
25+
- **TypeScript Support** - Complete type definitions for full IDE support
26+
- **Extensive Customization** - 30+ slot-based customization points
27+
- **Responsive Design** - Mobile-friendly with automatic popup positioning
28+
- **High Performance** - Optimized rendering with computed properties
29+
30+
# Demo
31+
32+
[![Vue Persian Calendar Demo](./docs/docs/.vuepress/public/images/demo.png)](https://codepen.io/mohamadhpp/pen/vELRmNa)
33+
34+
Try the component interactively. The demo showcases calendar selection, datepicker interaction, custom theming, and comprehensive event management.
35+
36+
View online demo: [Live CodePen Demo](https://codepen.io/mohamadhpp/pen/vELRmNa)
37+
38+
# Quick Start
39+
40+
## Installation
41+
42+
```bash
43+
npm install vue-persian-calendar
44+
```
45+
46+
## Basic Usage
47+
48+
```vue
49+
<script setup>
50+
import { PersianCalendar, PersianDatePicker } from 'vue-persian-calendar'
51+
</script>
52+
53+
<template>
54+
<!-- Full calendar -->
55+
<PersianCalendar />
56+
57+
<!-- Compact date picker -->
58+
<PersianDatePicker v-model="date" />
59+
</template>
60+
```
61+
62+
## Calendar Example
63+
64+
```vue
65+
<script setup>
66+
import { PersianCalendar } from 'vue-persian-calendar'
67+
68+
const handleSelectDate = (event) => {
69+
console.log(event.date) // [1403, 6, 15]
70+
console.log(event.events) // { persianEvents: [...], hijriEvents: [...], ... }
71+
}
72+
</script>
73+
74+
<template>
75+
<PersianCalendar
76+
theme="dark"
77+
@select-date="handleSelectDate"
78+
/>
79+
</template>
80+
```
81+
82+
## Date Picker Example
83+
84+
```vue
85+
<script setup>
86+
import { ref } from 'vue'
87+
import { PersianDatePicker } from 'vue-persian-calendar'
88+
89+
const selectedDate = ref(null)
90+
91+
const handleDateChange = (date) => {
92+
console.log('Date changed:', date)
93+
}
94+
</script>
95+
96+
<template>
97+
<PersianDatePicker
98+
v-model="selectedDate"
99+
format="text"
100+
@change="handleDateChange"
101+
/>
102+
</template>
103+
```
104+
105+
# Browser Support
106+
107+
- Chrome/Edge (latest)
108+
- Firefox (latest)
109+
- Safari (latest)
110+
- Mobile browsers (iOS Safari, Chrome Mobile)
111+
112+
# Accurate Date Conversions
113+
114+
The component uses precise conversion algorithms:
115+
116+
- **Jalali to Gregorian**: Accurate for all historical and future dates
117+
- **Jalali to Hijri**: Uses lookup tables for years 1427-1464 AH with fallback calculations
118+
- **Gregorian to Jalali**: Reverse conversion with high precision
119+
120+
# Event Categories
121+
122+
The calendar displays:
123+
124+
- **Persian Events**: 100+ official and commemorative days (رویدادهای ایرانی)
125+
- **Hijri Events**: 50+ Islamic religious events (رویدادهای اسلامی)
126+
- **World Events**: 200+ international observances (رویدادهای جهانی)
127+
128+
# License
129+
130+
MIT License - see [LICENSE](./LICENSE) file for details
131+
132+
# Contributing
133+
134+
Contributions are welcome! Please feel free to submit a Pull Request.
135+
136+
Steps to contribute:
137+
1. Fork the repository
138+
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
139+
3. Commit changes (`git commit -m 'Add AmazingFeature'`)
140+
4. Push to branch (`git push origin feature/AmazingFeature`)
141+
5. Open a Pull Request
142+
143+
# Support
144+
145+
For issues, questions, or feature requests, please open an issue on GitHub.
146+
147+
Need help? Check the [Documentation](https://vue-persian-calendar.vercel.app/) or review the [Examples](./docs/guide/examples.md).
148+
149+
# Changelog
150+
151+
See [CHANGELOG.md](./CHANGELOG.md) for version history and updates.
152+
153+
# Credits
154+
155+
Built with Vue 3 and TypeScript for the Persian-speaking community and beyond.

docs/docs/.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = crlf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = false
9+
max_line_length = 120
10+
tab_width = 8

docs/docs/.vuepress/config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defaultTheme } from '@vuepress/theme-default'
2+
import { defineUserConfig } from 'vuepress/cli'
3+
import { viteBundler } from '@vuepress/bundler-vite'
4+
5+
export default defineUserConfig({
6+
lang: 'en-US',
7+
8+
title: 'Vue Persian Calendar Datepicker',
9+
description: 'Persian calendar with Iran\'s official holidays and Iranian calendar events and Islamic and world events. And also support for Hijri and Gregorian dates in Vue',
10+
11+
head:
12+
[
13+
[
14+
'link',
15+
{ rel: 'icon', href: 'logo.svg' }
16+
]
17+
],
18+
19+
theme: defaultTheme({
20+
logo: 'logo.svg',
21+
22+
navbar: ['/', '/Introduction'],
23+
}),
24+
25+
bundler: viteBundler(),
26+
});
44.4 KB
Loading

0 commit comments

Comments
 (0)