persian_datetime_picker library

Classes

CupertinoTimerPicker
A countdown timer picker in iOS style.
Date
Super class of Jalali and Georgian classes
DateFormatter
super class for Jalali and Gregorian Date formatter
Gregorian
Gregorian (Miladi or Milaadi) date class
GregorianFormatter
Gregorian date formatter class
Jalali
Jalali (Shamsi or Persian) Date class
JalaliDate
JalaliFormatter
Jalali date formatter class
JalaliRange
Encapsulates a start and end Jalali that represent the range of dates between them.
PCalendarDatePicker
Displays a grid of days for a given month and allows the user to select a date.
PCupertinoDatePicker
A date picker widget in iOS style.
PDatePickerHeader
Re-usable widget that displays the selected date (in large font) and the help text above it.
PDayPicker
Displays the days of a given month and allows choosing a day.
PInputDatePickerFormField
PMonthPicker
A scrollable list of months to allow picking a month.
PYearPicker
A scrollable list of years to allow picking a year.

Enums

CupertinoTimerPickerMode
Different modes of CupertinoTimerPicker.
PCupertinoDatePickerMode
Different display modes of PCupertinoDatePicker.
PDatePickerEntryMode
Mode of the date picker dialog.
PDatePickerMode
Initial display of a calendar date picker.
PTimePickerEntryMode
Interactive input mode of the time picker dialog.

Properties

narrowWeekdays List<String>
getter/setter pair
shortDayName List<String>
getter/setter pair

Functions

addDaysToDate(Jalali date, int days) Jalali
Returns a Jalali with the added number of days and no time set.
addMonthsToMonthDate(Jalali monthDate, int monthsToAdd) Jalali
Returns a Jalali with the added number of months and truncates any day and time information.
dateOnly(Jalali date) Jalali
Returns a Jalali with just the date of the original, but no time set.
datesOnly(JalaliRange range) JalaliRange
Returns a JalaliRange with the dates of the original without any times set.
firstDayOffset(int year, int month) int
Computes the offset from the first day of the week that the first day of the month falls on.
formatDecimal(int number) String
formatFullDate(Jalali date) String
formatHour(TimeOfDay timeOfDay, {bool alwaysUse24HourFormat = false}) String
formatMediumDate(Jalali date) String
formatMinute(TimeOfDay timeOfDay) String
formatMonthYear(Jalali date) String
formatRangeEndDate(MaterialLocalizations localizations, Jalali? startDate, Jalali? endDate, Jalali? currentDate) String
Returns an locale-appropriate string to describe the end of a date range.
formatRangeStartDate(MaterialLocalizations localizations, Jalali? startDate, Jalali? endDate) String
Returns a locale-appropriate string to describe the start of a date range.
formatTimeOfDay(TimeOfDay timeOfDay, {bool alwaysUse24HourFormat = false}) String
formatYear(Jalali date) String
getDaysInMonth(int year, int month) int
isSameDay(Jalali? dateA, Jalali? dateB) bool
Returns true if the two Jalali objects have the same day, month, and year.
isSameMonth(Jalali dateA, Jalali dateB) bool
Returns true if the two Jalali objects have the same month, and year, or are both null.
monthDelta(Jalali startDate, Jalali endDate) int
Determines the number of months between two Jalali objects.
parseCompactDate(String inputString) Jalali
showPersianDatePicker({required BuildContext context, required Jalali initialDate, required Jalali firstDate, required Jalali lastDate, PDatePickerEntryMode initialEntryMode = PDatePickerEntryMode.calendar, PSelectableDayPredicate? selectableDayPredicate, String? helpText, String? cancelText, String? confirmText, Locale? locale, bool useRootNavigator = true, RouteSettings? routeSettings, TextDirection? textDirection, TransitionBuilder? builder, PDatePickerMode initialDatePickerMode = PDatePickerMode.day, String? errorFormatText, String? errorInvalidText, String fieldHintText = '##/##/####', String fieldLabelText = 'ورود تاریخ'}) Future<Jalali?>
Shows a dialog containing a Material Design date picker.
showPersianDateRangePicker({required BuildContext context, JalaliRange? initialDateRange, required Jalali firstDate, required Jalali lastDate, Jalali? currentDate, PDatePickerEntryMode initialEntryMode = PDatePickerEntryMode.calendar, String? helpText, bool? showEntryModeIcon, String? cancelText, String? confirmText, String? saveText, String? errorFormatText, String? errorInvalidText, String? errorInvalidRangeText, String? fieldStartHintText, String? fieldEndHintText, String? fieldStartLabelText, String? fieldEndLabelText, Locale? locale, bool useRootNavigator = true, RouteSettings? routeSettings, TextDirection? textDirection, TransitionBuilder? builder}) Future<JalaliRange?>
Shows a full screen modal dialog containing a Material Design date range picker.
showPersianTimePicker({required BuildContext context, required TimeOfDay initialTime, TransitionBuilder? builder, bool useRootNavigator = true, PTimePickerEntryMode initialEntryMode = PTimePickerEntryMode.dial, String cancelText = 'لغو', String confirmText = 'تایید', String helpText = 'انتخاب زمان', RouteSettings? routeSettings}) Future<TimeOfDay?>
Shows a dialog containing a material design time picker.
timeOfDayFormat({bool alwaysUse24HourFormat = false}) TimeOfDayFormat

Typedefs

PSelectableDayPredicate = bool Function(Jalali? day)
Signature for predicating dates for enabled date selections.

Exceptions / Errors

DateException
date exception