viet_date_time 0.1.0 copy "viet_date_time: ^0.1.0" to clipboard
viet_date_time: ^0.1.0 copied to clipboard

Hỗ trợ trong việc chuyển đổi và tính toán ngày tháng, thời gian và can chi theo lịch Việt Nam.

Viet Date Time #

Hỗ trợ trong việc chuyển đổi và tính toán ngày tháng, thời gian và can chi theo lịch Việt Nam.

Sử Dụng #

Khai báo theo ngày tháng cu thê:

// Ngày 1 tháng 10 năm 2023 và tháng 10 không phải tháng nhuần
final vietDateTime = VietDateTime(2023, 10, 1);

// Ngày 1 tháng 10 năm 2023 và tháng 10 và là tháng nhuần
final vietDateTime = VietDateTime.leapMonth(2023, 10, 1);

Chuyển đổi từ DateTime:

final vietDateTime = VietDateTime.now();
// Or
final vietDateTime = VietDateTime.fromDateTime(DateTime.now());
// Or
final vietDateTime = DateTime.now().toVietDateTime;

Chuyển từ VietDateTime sang DateTime:

final dateTime = vietDateTime.toDateTime();

Kiểm tra tháng hiện tại có phải tháng nhuần hay không

final isLeapMonth = vietDateTime.isLeapMonth;

Bạn có thể sử dụng các phép tính như DateTime và có thể sử dụng thay thế cho DateTime

vietDateTime.add(Duration(days: 3));
vietDateTime.compareTo(VietDateTime.fromSolar(DateTime.now()));

Thông tin các ngày lễ trong năm:

// Các ngày lễ theo âm lịch
// Kết quả sẽ là danh sách với thời gian tính theo `VietDateTime`
VietDateTime.lunarEvents;

// Các ngày lễ theo dương lịch
// Kết quả sẽ là danh sách với thời gian tính theo `DateTime`
VietDateTime.solarEvents; 
0
likes
140
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

Hỗ trợ trong việc chuyển đổi và tính toán ngày tháng, thời gian và can chi theo lịch Việt Nam.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

equatable

More

Packages that depend on viet_date_time