DateUtil class

工具类

Constructors

DateUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getCurrentRow(DateTime currentTime, int offset) int
当前在第几行
getIndexDayInWeek(DateTime dateTime) int
本周的第几天
getIndexOfFirstDayInMonth(DateTime dateTime, {int offset = 0}) int
本月第一天,是那一周的第几天,从1开始 @return 获取日期所在月视图对应的起始偏移量 the start diff with MonthView
getIndexWeekInMonth(DateTime dateTime) int
本月的第几周
getMonthDaysCount(int year, int month) int
获取某月的天数
getMonthViewLineCount(int year, int month, int offset) int
月的行数
getYearDaysCount(int year) int
initCalendarForMonthView(int year, int month, DateTime currentDate, int weekStart, {required DateModel minSelectDate, required DateModel maxSelectDate, required Map<DateModel, Object> extraDataMap, int offset = 0}) List<DateModel>
initCalendarForWeekView(int year, int month, DateTime currentDate, int weekStart, {required DateModel minSelectDate, required DateModel maxSelectDate, required Map<DateModel, dynamic> extraDataMap, int offset = 0}) List<DateModel>
获取本周的7个item
isCurrentDay(int year, int month, int day) bool
是否是今天
isLeapYear(int year) bool
是否是闰年
isWeekend(DateTime dateTime) bool