Dayfl class

Constructors

Dayfl([dynamic datetime, String formatStr = ''])
datetime 支持传入格式 Dayfl | String | int | DateTime

Properties

dateTime DateTime?
获取时间 返回 DateTime
no setter
day String
获取日 String
no setter
daysInMonth int?
获取当前日期月份天数
no setter
hashCode int
The hash code for this object.
no setterinherited
hour String
获取小时 String
no setter
isLeapYear bool?
是否是闰年
no setter
isUtc bool?
isUtc
no setter
minute String
获取分钟 String
no setter
month String
获取月 String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
second String
获取秒 String
no setter
setLocale String
设置语言
no getter
valueOf int?
获取时间戳 单位毫秒
no setter
year String
获取年 String
no setter

Methods

add(DateLocationEnum type, int num) Dayfl
添加日期
compareTo(dynamic date) int
和DateTime 的 compareTo 方法一样
difference(dynamic date) Duration
时间差 两个时间相差 小时数
format([String formatStr = Location.defaultFormatStr, String locale = '', dynamic dayFormat = false]) String
格式化
getLocale([String name = '']) Locale
获取当前使用语言包
getWeek([String locale = '']) Map<String, dynamic>
获取week
isAfter(dynamic date) bool
之后
isBefore(dynamic date) bool
之前
isSame(Dayfl dayfl, [DateLocationEnum type = DateLocationEnum.millisecondsSinceEpoch]) bool
判断日期是否相同
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subtract(DateLocationEnum type, int num) Dayfl
减去日期
toArray() List<int>
转换成数组 dayfl('2019-01-25').toArray() // 2019, 0, 25, 0, 0, 0, 0
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

addLocale(Locale arg) bool
添加语言
addMatchers(String key, MatchersFunc matchersFunc) → void
新增格式化参数
delMatchers(String key) → void
删除自定添加的格式化参数