=== LNH Lunar Calendar ===
Contributors: tobevn
Tags: lunar calendar, vietnamese calendar, shortcode, âm lịch, lịch vạn niên
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 2.9.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires PHP: 7.0

Display an accurate Vietnamese Lunar-Solar Calendar via shortcode. Supports multiple layouts, dark mode, interactions, and dynamic Zodiac Hours.

== Description ==

**LNH Lunar Calendar** là plugin hoàn hảo và nhẹ nhất giúp bạn hiển thị **lịch âm**, **lịch vạn niên**, và **lịch âm dương** trực tiếp trên website WordPress. Với thiết kế giao diện hiện đại, tối giản, bạn có thể dễ dàng chèn một bảng lịch hoặc widget xem ngày tháng thông qua shortcode vào bất cứ vị trí nào trên trang.

Plugin cung cấp thông tin chuẩn xác tuyệt đối về **ngày âm lịch**, **ngày dương lịch**, thông tin Can Chi, và đặc biệt tự động tính toán **giờ hoàng đạo** cho từng ngày, giúp người dùng dễ dàng tra cứu ngày tốt xấu, giờ đẹp. Đây là một công cụ không thể thiếu cho các website tin tức, tử vi, phong thủy, hoặc các blog hướng tới người dùng Việt Nam.

### Tính năng nổi bật (Key Features):

* **Tích hợp linh hoạt**: Dùng shortcode `[lnh_lunar_calendar]` để chèn lịch âm dương ở bất cứ đâu.
* **Đa dạng Layouts**: 
    * `widget`: Lịch rút gọn siêu đẹp cho Sidebar hoặc Footer.
    * `full`: Hiển thị bảng lịch âm theo tháng toàn diện với hộp thông tin chi tiết.
    * `inline`: Dòng chữ thông báo ngày tháng âm/dương lịch nhỏ gọn.
* **Giao diện hiện đại & Dark Mode**: Hỗ trợ chế độ nền tối (Dark mode) cực sang trọng, bo góc tròn hiện đại, tương thích 100% với thiết bị di động (Mobile Responsive).
* **Tra cứu Giờ Hoàng Đạo chính xác**: Thuật toán tính toán chuẩn xác giờ hoàng đạo, giờ hắc đạo dựa trên Địa Chi của từng ngày.
* **Chuyển tháng bằng AJAX siêu tốc**: Tối ưu hiệu năng tối đa, không cần tải lại trang (reload) khi chuyển tháng, giúp website luôn giữ tốc độ load nhanh nhất, thân thiện với SEO.
* **Tùy biến dễ dàng**: Hỗ trợ dịch và thay đổi các từ như "Ngày", "Tháng", "Năm" dễ dàng trong Cài đặt.

---

**LNH Lunar Calendar** is a highly optimized plugin that allows you to easily display a beautiful, modern **Lunar-Solar calendar** (Vietnamese Calendar / Lịch Vạn Niên) anywhere on your WordPress site using a simple shortcode. 

It provides accurate information about the lunar date, solar date, Can Chi (Stem-Branch), and dynamically calculated **Zodiac Hours** for auspicious timing. With AJAX navigation and a sleek UI (including Dark Mode), this plugin ensures the best user experience without slowing down your site.

== Installation ==

Upload the lnh-lunar-calendar folder to the /wp-content/plugins/ directory.

Activate the plugin through the 'Plugins' menu in WordPress.

Go to Settings > LNH Lunar Calendar to customize default settings and translations.

Use the shortcode in your posts, pages, or widgets. Here are some examples:

For the compact widget view: [lnh_lunar_calendar]

For the full monthly calendar: [lnh_lunar_calendar layout="full"]

For a single line of text: [lnh_lunar_calendar layout="inline"]

To use the dark theme: [lnh_lunar_calendar layout="full" theme="dark"]

== Frequently Asked Questions ==

= How do I use the shortcode? =

You can insert the shortcode into any WordPress text editor. Here are some examples:

Basic Widget: [lnh_lunar_calendar]

Full Month Calendar: [lnh_lunar_calendar layout="full"]

Using the Dark Theme: [lnh_lunar_calendar layout="full" theme="dark"]

= How does the interactive feature work? =

The layout="full" shortcode automatically includes a detailed header. When you click on any day in the calendar grid, this header will update to show the detailed information for the selected day. If you also place a [lunar_calendar] widget on the same page, it will be updated as well.

= Can I translate words like "Day", "Month", "Monday", etc.? =

Yes. Go to Settings > LNH Lunar Calendar > Translate. Here you can enter custom translations for the text strings displayed on the front end.

== Screenshots ==

The full monthly calendar (layout="full") with its integrated details header.

The full calendar in the new dark mode (theme="dark").

The interactive feature in action: a user clicks on a day, and the header updates with the correct details.

The plugin's settings page with the "General" and "Translate" tabs.

== Changelog ==

= 2.9.1 =

Tweak: Updated plugin icon/thumbnail.
Fix: Fixed an issue where the calendar header text was invisible in Dark Mode.

= 2.9.0 =

Feature: Completely rebuilt navigation to use AJAX for a much faster, lag-free experience.
Feature: Modernized the calendar UI with rounded corners, soft shadows, and smooth hover effects.
Fix: Performance improvements and optimized cache handling.

= 2.8.6 =

Fix: Resolved a critical bug where calendar month navigation failed on WordPress 7.0 due to nonce being cached inside the Transient API, causing it to become stale and fail verification.

= 2.8.5 =

Feature: Added a beautiful dark mode (theme="dark") for the full calendar layout.

= 2.8.3 =

Fix: Resolved a critical bug where calendar navigation (next/prev month) would fail if the mbstring PHP extension was not enabled on the server.

= 2.8.2 =

Tweak: Weekday headers in the full calendar now automatically switch to single-letter abbreviations on mobile devices for a cleaner look.

= 2.8.1 =

Tweak: Added a current-day class to the present day in the full calendar for easier styling.

= 2.8.0 =

Major Feature: Implemented dynamic Zodiac Hours. The auspicious hours are now accurately calculated for each day based on its specific Earthly Branch (Chi).

= 2.7.0 =

Feature: Integrated a widget-like details header directly into the layout="full" view for a more comprehensive experience.

= 2.6.1 =

Fix: Resolved a JavaScript Invalid URL error by rewriting the navigation logic to be more robust.

= 2.5.1 =

Fix: Corrected a bug where the month's Can Chi (Stem-Branch) was missing on the initial load and showed "undefined" on click.

= 2.5.0 =

Fix: Updated plugin to comply with WordPress.org guidelines, including author information, English readme, and proper code prefixing.

= 1.0.0 =

Initial release.

== Upgrade Notice ==

= 2.9.1 =
Minor update for plugin icon and a quick CSS fix for Dark Mode header.

= 2.9.0 =
Major performance and UI update. Navigation is now lag-free using AJAX, and the interface is much more modern.

= 2.8.6 =
Fixes a critical calendar navigation bug on WordPress 7.0. Updating is strongly recommended.