new Datetime(name, type, schema, value, $endpoint, service, $states, relationName)
Apy Datetime Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Field name |
type |
string | Field type |
schema |
Object | Field schema |
value |
Object | Field value |
$endpoint |
string | Field endpoint |
service |
Object | Reference to Service instance |
$states |
Object | Field inner state holder instance |
relationName |
string | (optional) Field relation name |
Extends
Methods
-
<static> cleanedData()
-
Return a datetime represented in UTC time
Returns:
datetime represented in UTC time
- Type
- string
-
<static> cloneValue(date)
-
Clone the datetime either as string or as object
Parameters:
Name Type Description date
string | Date A datetime string or object
Returns:
A datetime object
- Type
- Date
-
<static> hasUpdated()
-
Is the time between memo and current value different ?
Returns:
whether it is updated or not
- Type
- boolean
-
<static> toString()
-
Datetime field string representation
Returns:
Datetime field string representation
- Type
- string
-
<static> validate()
-
Validate Field value
Throws:
-
When current value is not a datetime object
- Type
- apy.errors.Error
-