|
| 1 | +# 🧧 ChineseCalendar |
| 2 | + |
| 3 | +[](https://www.gnu.org/licenses/gpl-3.0) |
| 4 | +[](#) |
| 5 | +[](https://dotnet.microsoft.com/) |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🧩 Overview |
| 10 | + |
| 11 | +**ChineseCalendar** is a bilingual Chinese lunar calendar and fortune library for **.NET 8**, developed by **skai**. |
| 12 | + |
| 13 | +It provides accurate Chinese lunar–solar date conversion, zodiac (生肖), heavenly stems & earthly branches (干支), |
| 14 | +solar terms (节气), and BaZi (八字) fortune calculations — all available in both **Chinese** and **English**. |
| 15 | + |
| 16 | +Ideal for use in cultural, educational, or astrology-related applications. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## 🌙 Features |
| 21 | + |
| 22 | +- 🔢 **Lunar ↔ Gregorian date conversion** (农历与公历互转) |
| 23 | +- 🐉 **Zodiac & GanZhi (干支)** calculation |
| 24 | +- ☯️ **BaZi (八字)** chart generation and explanation |
| 25 | +- 🗓️ **Solar Terms (二十四节气)** recognition |
| 26 | +- 💫 **Daily, Monthly, and Yearly fortune** summaries with good/bad activities (宜/忌) |
| 27 | +- 🌐 **Full bilingual output** (Chinese + English) |
| 28 | +- ⚙️ **Compatible with .NET 8**, UTF-8 consoles, and multi-platform projects |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## 🧠 Usage Example |
| 33 | + |
| 34 | +```csharp |
| 35 | +using ChineseCalendarLib; |
| 36 | + |
| 37 | +// Get today's information |
| 38 | +var today = ChineseCalendar.GetToday("Asia/Kuala_Lumpur"); |
| 39 | +Console.WriteLine($"Lunar: {today.LunarTextEN} | Zodiac: {today.ZodiacEN}"); |
| 40 | + |
| 41 | +// Get daily fortune for a specific date |
| 42 | +var fortune = ChineseCalendar.GetDailyFortune(new DateTime(1990, 5, 17)); |
| 43 | +Console.WriteLine($"Date: {fortune.Date:yyyy-MM-dd}"); |
| 44 | +Console.WriteLine($"Zodiac: {fortune.ZodiacEN}"); |
| 45 | +Console.WriteLine($"Luck Index: {fortune.LuckIndex}/5"); |
| 46 | +Console.WriteLine($"Overall Fortune: {fortune.OverallFortuneEnglish}"); |
0 commit comments