Skip to main content

jalali_date 1.0.0 copy "jalali_date: ^1.0.0" to clipboard
jalali_date: ^1.0.0 copied to clipboard

Persian (Jalali) calendar for Dart: convert between Gregorian and Jalali dates, leap years, month lengths, formatting. Pure Dart, works on Web, Flutter and the Dart VM.

example/main.dart

import 'package:jalali_date/jalali_date.dart';

void main() {
  // Gregorian to Jalali.
  final nowruz = PersianDate.fromGregorian(2021, 3, 21);
  print(nowruz); // 1400/01/01
  print(nowruz.format('EEEE d MMMM yyyy')); // یکشنبه 1 فروردین 1400

  // Jalali to Gregorian.
  final date = PersianDate(1357, 11, 22);
  print(date.toDateTime()); // 1979-02-11 00:00:00.000

  // Leap years and month lengths.
  print(PersianDate(1399, 12, 1).isLeapYear); // true
  print(PersianDate(1399, 12, 1).monthLength); // 30

  // Current date and time.
  print(PersianDate.now().toString(showTime: true));
}
3
likes
0
points
118
downloads

Publisher

verified publishernodets.com

Weekly Downloads

Persian (Jalali) calendar for Dart: convert between Gregorian and Jalali dates, leap years, month lengths, formatting. Pure Dart, works on Web, Flutter and the Dart VM.

Repository (GitHub)
View/report issues

Topics

#jalali #persian #shamsi #date #calendar

License

unknown (license)

More

Packages that depend on jalali_date