ModelTimestamp class
Define the field as a timestamp.
The base value is given as value. If not given, the current time is set.
By passing this to the server, the timestamp on the server side is stored as data.
フィールドをタイムスタンプとして定義します。
ベースの値をvalueとして与えます。与えられなかった場合現在時刻がセットされます。
これをサーバーに渡すことでサーバー側のタイムスタンプがデータとして保存されます。
- Inheritance
-
- Object
- ModelFieldValue<
DateTime> - ModelTimestamp
- Implemented types
- Annotations
Constructors
- ModelTimestamp([DateTime? value])
-
Define the field as a timestamp.
constfactory
- ModelTimestamp.dateTime(int year, [int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond])
-
Define the field as a timestamp.
constfactory
- ModelTimestamp.fromJson(DynamicMap json)
-
Convert from
json
map to ModelTimestamp.factory - ModelTimestamp.fromServer([DateTime? value])
-
Used to disguise the retrieval of data from the server.
constfactory
- ModelTimestamp.now()
-
Define the field as a timestamp.
constfactory
Properties
Methods
-
compareTo(
ModelTimestamp other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → DynamicMap -
Methods for Json serialization.
override
-
toModelDate(
) → ModelDate - Convert to ModelDate.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator <(
ModelTimestamp other) → bool - Compare with other ModelTimestamp.
-
operator <=(
ModelTimestamp other) → bool - Compare with other ModelTimestamp.
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
ModelTimestamp other) → bool - Compare with other ModelTimestamp.
-
operator >=(
ModelTimestamp other) → bool - Compare with other ModelTimestamp.
Static Methods
-
parse(
String formattedString) → ModelTimestamp -
Parse from
formattedString
and convert to ModelTimestamp. -
tryParse(
String formattedString) → ModelTimestamp? -
Parse from
formattedString
and convert to ModelTimestamp.
Constants
- kNowKey → const String
-
A value key that should be set to
true
if the current time is used. - kSourceKey → const String
- Key to store the data source.
- kTimeKey → const String
- Key to save time.
- typeString → const String
- Type key.