full_calender
全功能日历Flutter库可轻松实现公历、农历和儒略日之间的转换,重点支持越南农历系统。
这是一个 Flutter 包
以下为英文项目原文快照,最新内容请访问 GitHub。
Welcome to the Full Calendar Library! This library provides a comprehensive set of tools for working with lunar dates, stems, branches, and more, making it easy to integrate traditional calendar features into your Flutter applications.
To use this library, add the following dependency to your pubspec.yaml file:
dependencies:
full_calender:
Then run:
$ flutter pub get
Import the library in your Dart code:
import 'package:full_calender/full_calender.dart';
Lunar Date Conversion
// Convert lunar date to solar date
final lunarDate = LunarDateTime(year: 2023, month: 11, day: 10);
final solarDate = FullCalenderExtension.convertLunarDateToSolarDate(lunarDate);
print(solarDate); // Output: 2023-12-28
Stems and Branches
// Get stem and branch for a specific year
final stemBranchOfYear = StemBranch.year(2023);
print(stemBranchOfYear.name(LanguageName.vietNam)); // Output: Kỷ Hợi
Lucky Day and Hour Detection
// Check if a specific day is considered lucky
final luckyDay = FullCalender(date: DateTime(2023, 12, 28)).lunarDate.isLuckyDay;
print(luckyDay); // Output: true
// Get a list of lucky hours for a specific date
final luckyHours = FullCalender(date: DateTime(2023, 11, 20)).lunarDate.listLuckyHours;
print(luckyHours); // Output: [true, true,false,true,false,false,true,false,true,true,false,false]
Stems and Branches
// Get stem and branch for a specific year
final stemBranchOfYear = StemBranch.year(2023);
print(stemBranchOfYear.name(LanguageName.vietNam)); // Output: Kỷ Hợi
For more examples, check out the example directory.
Issues and Feedback Please file issues or provide feedback on our GitHub repository.
依赖清单 4 项
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0^1.24.3先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗